May 04, 2024, 08:00:48 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


The correct way to declare multiple pointer variables

Started by Parker, January 06, 2006, 07:28:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

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.

Ionic Wind Support Team

The second way.  The first way delcares a pointer to a string, and a string variable

Paul.
Ionic Wind Support Team

Parker

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* ;)

Zen

Thats a nasty cough you have there Parker. Try some cough medicine lol

Lewis