//Çok basit bir program. Değişkenlerin uzunluklarını bulmak için sadece "sizeof()" komutunu kullanacağız. 

#include<stdio.h>
#include<conio.h>
main()
{
int a;
float b;
char c;
double d;
longint e;
longdouble f;
shortint g;

printf("int uzunlugu=%d \n", sizeof(a));
printf("float uzunlugu=%d \n", sizeof(b));
printf("char uzunlugu=%d \n", sizeof(c));
printf("double uzunlugu=%d \n", sizeof(d));
printf("longint uzunlugu=%d \n", sizeof(e));
printf("longdouble uzunlugu=%d \n", sizeof(f));
printf("shortint uzunlugu=%d \n", sizeof(g));

getch();

}
/*boylece değişken tiplerinin byte uzunluğunu buluyoruz.
C'de değişkenlerin boyutlarına çok dikkat etmemiz gerekir.
Yaptığımız programları ne kadar en az hafıza ile yaparsak program
o kadar hızlı çalışır. */

3 kişi tarafından 2.7 olarak değerlendirildi

  • Currently 2,666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5