IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Parker on January 06, 2006, 07:28:22 PM

Title: The correct way to declare multiple pointer variables
Post by: Parker on January 06, 2006, 07:28:22 PM
I was just wondering, since I hadn't been able to figure it out, what is the correct way to declare multiple pointer variables?
// First way
string *pStr1, pStr2;

assuming that string* is the type
//Second way
string *pStr1, *pStr2;

assuming that string is the type, and pStr1, pStr2 are pointers of that type.
Title: Re: The correct way to declare multiple pointer variables
Post by: Ionic Wind Support Team on January 06, 2006, 07:32:40 PM
The second way.  The first way delcares a pointer to a string, and a string variable

Paul.
Title: Re: The correct way to declare multiple pointer variables
Post by: Parker on January 06, 2006, 07:35:38 PM
Alright thanks. Strings are a nice thing to have, but the non-dynamicness of them is hard to work with when you're loading files that could be 10 or 10 000 lines. *cough* operator-overloading *cough* ;)
Title: Re: The correct way to declare multiple pointer variables
Post by: Zen on January 06, 2006, 07:41:53 PM
Thats a nasty cough you have there Parker. Try some cough medicine lol

Lewis