On what does size of data types depend?
- From: "Sunil" <sunil.goutham@xxxxxxxxx>
- Date: 5 Oct 2005 02:05:12 -0700
Hi all,
I am using gcc compiler in linux.I compiled a small program
int main()
{
printf("char : %d\n",sizeof(char));
printf("unsigned char : %d\n",sizeof(unsigned char));
printf("short : %d\n",sizeof(short));
printf("unsigned short : %d\n",sizeof(unsigned short));
printf("int : %d\n",sizeof(int));
printf("unsigned int : %d\n",sizeof(unsigned int));
printf("long : %d\n",sizeof(long));
printf("unsigned long : %d\n",sizeof(unsigned long));
printf("long long : %d\n",sizeof(long long));
printf("unsigned long long : %d\n",sizeof(unsigned long
long));
}
Result was
char : 1
unsigned char : 1
short : 2
unsigned short : 2
int : 4
unsigned int : 4
long : 4
unsigned long : 4
long long : 8
unsigned long long : 8
What i want to know is what will be the effect if i use int in
place of long in applications running on linux and also on what factors
does the size of datatypes depend.
Thanks
Sunil.
.
- Follow-Ups:
- Re: On what does size of data types depend?
- From: Christian Bau
- "Portability" contructs like UINT32 etc.
- From: John Devereux
- Re: On what does size of data types depend?
- From: tanmoy87544
- Re: On what does size of data types depend?
- From: Eric Sosman
- Re: On what does size of data types depend?
- From: EventHelix.com
- Re: On what does size of data types depend?
- Prev by Date: Re: Modularisation
- Next by Date: Re: Modularisation
- Previous by thread: Algorithm newsgroup?
- Next by thread: Re: On what does size of data types depend?
- Index(es):
Relevant Pages
|