2.
#include<iostream>
using namespace std;
int main(){
int n = 255, i;
char *p = (char *)&n;
for(i = 0; i < sizeof(int); i++)
cout<<(unsigned int)p[i]<<"\n";
cin.get();
return 0;
}
Output:
4294967295
0
0
0
I think p[0] is 11111111.So why it is giving 4294967295 in the first line.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.