Showing posts with label c++. Show all posts
Showing posts with label c++. Show all posts
Thursday, September 15, 2011
error: expected expression before ')' token
Maybe you have an extra comma at the end of your list of arguments. ;)
C programming compare pointers to numbers
You want to check if a particular pointer is at an address.
If the pointer is of uint32_t* type, trying to make an address in in uint32_t might throw you this error: error: this decimal constant is unsigned only in ISO C90.
Here is what you can do:
If the pointer is of uint32_t* type, trying to make an address in in uint32_t might throw you this error: error: this decimal constant is unsigned only in ISO C90.
Here is what you can do:
uint32_t* ptr;
ptr = get_it_some_how();
cprintf(" get the int of address: %08d \n", ptr);
int* target = (int *) -267296968; // this is the int you copy from the printout above
if( ptr == (uint32_t*) target ) // look! a cast!
cprintf(" yay the pointer is at target!\n");
else
cprintf(" noo! the pointer is not at target\n");
Subscribe to:
Posts (Atom)