Re: [Dev-C++] Addresses and Pointers
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: w.y. <yok...@ve...> - 2003-08-26 05:36:50
|
André Macário Barros wrote: > > /* p4.c */ > ... > 1-int x=16, *p; > 2- > 3-p=&x; > 4-printf(%d\n, &*x); > - &* and *& cancel themselves > > --->But p4.c isn´t working. The compiler is presenting the following error > message: > "Invalid type argument of ´unary´" The way I read &*x is first x is dereferenced, so it becomes &16 and you cannot use the 'address of' operator & on a number, 16, so you get an error. |