my query s about data types .........
int 2 byte (means 16 bit) so how the dATAS ARE STORING I NEED CLEAR EXPLANATION
NOT ONLY INT FOR CHAR ,FLOAT,LONG ,DOUBLE SHORT ........ THEN SIGNED ,UNSIGNED.........
my query s about data types .........
int 2 byte (means 16 bit) so how the dATAS ARE STORING I NEED CLEAR EXPLANATION
NOT ONLY INT FOR CHAR ,FLOAT,LONG ,DOUBLE SHORT ........ THEN SIGNED ,UNSIGNED.........
Theyre stored in ram or on disk. Same with all the other types. If thats not a "clear explanation" then you have to ask your question clearly.
Are you asking how these bytes are represented in memory, theyre byte order? See this link which has a few simple pictures for types of endian. Also, review that whole page, not just the pictures there. Endianness - Wikipedia, the free encyclopedia
Well, a 16-bit integer is stored as a binary value 16 digits long. So is a (16-bit) float. A char (1 byte) is also stored as a binary value.
See the ASCII Table / Extended ASCII Codes for a better understand of how a char "letter" is stored as a numerical value.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
On a side note, review little endian and big endian may help as well here. The actual placement of MSB is important on some systems especially in transfering bits across the network. Something to think about.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
[Range of 'int']: Signed: −32,768 to +32,767, Unsigned: 0 to +65,535 (source: http://en.wikipedia.org/wiki/Integer...ter_science%29). I believe by "default", types are signed. So 'int y =50000' overflows the maximum value that a signed 'int' can store, so you would need to make it an 'unsigned int y=50000' instead.
I still dont understand what your asking. Did you read the link I posted about Endianness? That shows how the bytes are stored in memory.bytes how they r converting and how it stores in memory .....
Data storage in memory is depends on the hardware and OS you are using
lets say i am using a 32 Bit OS on a 32 Bit Machine i think which normally available with all of us now a days. Now 64 Bit Machines and OS are also coming.
And it also depends which endianess machine is :----
For Little indian
char will be stored in i Byte means 8 bit lets say you want to store 'A'
then it will be stored in memory like 1000001
and if it will be int then it will take normally 4 bytes for float and long also it will take this much of bytes.
And the value will be store in 32 bits ..... for max value u can just do 1 << 32
But in case of big endian
the MSB will be stored at lower address and in little endian the MSB will stored at higher address this causes the problem in conversion from one to another.....
You also have to look at how the structures are adjusted into the memory and just google the structure padding you will get to know about this also
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010