RE: [Dev-C++] One other minor problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@at...> - 2003-04-13 02:05:59
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Shane Plesner > Sent: Sunday, April 13, 2003 4:31 AM > To: dev...@li... > Subject: [Dev-C++] One other minor problem >=20 >=20 >=20 > I also have one other minor problem. >=20 > Though I have looked through over 16 different manuals and=20 > tutorials, and have searched over 50 websites I cannot seem=20 > to find out the difference between >=20 > char* foo; > char *foo; > char* *foo; >=20 > >From my own expirements (purposely generating compiler=20 > errors) it appears to me that the first two are identical. =20 Yes they are. > They both seem to declare foo to be a variable of type char*.=20 > The second seems to declare foo a pointer to type char*. The third. Yes, it is a pointer to char *. Or a pointer to pointer to = char. > It=20 > also appears to me that type char* is actually a char[] of=20 > dynamic length because I can get string functions to work on=20 > it - just like on char[]. char * points to a char variable. This variable can be part of a = sequence of chars (an array) either on the free store either in the automatic = storage. But it can also be alone. 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 Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |