I thank the REAL help. the rest? I feel what i did was propitiate. don't like it? report me or band me if you like.
I'm rude? some of you are not much better either. and I think i 'm done with you...
Type: Posts; User: firebird
I thank the REAL help. the rest? I feel what i did was propitiate. don't like it? report me or band me if you like.
I'm rude? some of you are not much better either. and I think i 'm done with you...
Are you saying that foo won't be 0x11, 0xff, 0xaa or 0x55? and the pattern I want it to get is 0b00010001, 0b11111111, 0b10101010 or 0b01010101. I believe this has no much to do with overflow.
I got it and I appreciate the help. but every one can easily see what this post has been turned into. besides, he's point is really no point at all.
see the comment "// foo = 0x11"
this is what i want it to be. what is your question? don't answer it if you don't intent to help.
I'm aware of that char type can only store values that are in its assigned range. As I've clarified that I don't care about the value store in a char type variable but the pattern. I still don't get...
update:
#define DUMMY1 0x1111...
#define DUMMY2 0xffff...
#define DUMMY3 0xaaaa...
#define DUMMY4 0x55...
...
char foo;
char dummy[] = {(char)DUMMY1, (char)DUMMY2, (char)DUMMY3,...
foo = dummy[0];
is not ok?
an how is
char dummy[] = {(char)DUMMY1, (char)DUMMY2, (char)DUMMY3, (char)DUMMY4};
broken?
I have a project BIG RULE need to follow about casting:
1. Use sparingly. They mask any checking the compiler would perform.
2. Unnecessary to cast the return pointer of malloc().
3. Unnecessary...
#define BYTE(thing,offset) (*(((unsigned char*)&thing)+offset))
#define WORD(thing) (*((unsigned int*)&thing))
The code above are two macros used to isolate a byte of a multi-byte thing....
Thank you guys very much.
I thought this code:
{ int myInt;
myInt = 5;
printf( "myInt++ ---> %d\n\n++myInt ---> %d", myInt++, ++myInt);
}
will yield:
"myInt++ ---> 5