RE: [Dev-C++] Addresses and Pointers
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-08-26 14:41:12
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Andr? Macario Barros > Sent: Tuesday, August 26, 2003 6:52 AM > To: Dev-Cpp-Users > Subject: [Dev-C++] Addresses and Pointers >=20 >=20 > Dear Users, >=20 > Please consider the following codes: >=20 > /* p1.c */ > ... > 1-int x=3D16, *p; > 2- > 3-p=3D&x; > 5-printf(=93%p\n=94, *&p); I just got a headache. Let's skip the others and concentrate on the = point you ask. =20 > /* p4.c */ > ... > 1-int x=3D16, *p; > 2- > 3-p=3D&x; > 4-printf(=93%d\n=94, &*x); > ... > --->But p4.c isn=B4t working. The compiler is presenting the=20 > following error > message: > "Invalid type argument of =B4unary=B4" x is a variable of type int. This means, that the dereference operator * can't be applied to it. * can be applied only to pointers. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |