Hi friends.
this is my code
Code:
#include<stdio.h>
#include<string.h>
int main()
{
char buf[4]={'5','a','4','b'};
int i;
i=(int)buf;
printf("%d\n",sizeof(int));
printf("%d\n",sizeof(buf));
printf("%c",buf[0]);
printf("%c",buf[1]);
printf("%c",buf[2]);
printf("%c\n\n",buf[3]);
printf("%d",i);
return 0;
}
what i wanted to know is ...when there is an array of 4 charecters...can i take that to an integer..(where int is 4 bytes). say the array is '5' 'a' '4' 'b' and when i take this array to a single integer of 4 bytes i want the exact "5a4b" in the integer...is this possible anyway...just a thing struck my mind....