I'm trying to create an array of pointers, but I have no idea how. Can anyone show me an example of how to create one?
Thanks,
...Dan
I'm trying to create an array of pointers, but I have no idea how. Can anyone show me an example of how to create one?
Thanks,
...Dan
That's what you mean?Code:int* Array[1337];
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
you mean this:
char* arrayname[100];
or:
int* num[10];
Hello, testing testing. Everthing is running perfectly...for now
int * arrayName[10];
arrayName is an array of 10 pointers to type int
You're only born perfect.
Yeah thanks guys I think that's it.
Well that was simple
...Dan
Since this is the C++ forum, how about an STL container instead?, eg,
Code:std::vector<int*> foo;etcCode:std::deque<int*> bar;
Well, if you really want to be C++ about it:Code:std::vector<std::tr1::shared_ptr<int> > foo;
I see that and raise youOriginally Posted by Daved
less typing == I win!!Code:boost::ptr_vector<int> foo;
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?
Boost isn't part of the c++ standard just yetOriginally Posted by ChaosEngine
>> less typing == I win!!
Amount of typing isn't an appropriate determinant of victory.
But you still win.
technically, neither is TR1.Originally Posted by Quantum1024
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?
Sine array is very similar to pointer, you could also do it like this :
since "int* i" is same as "int i[]"Code:int** i;
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
Heh, I got myself into some hot water with Salem and Dave_Sinkula over that claim on another forumOriginally Posted by ElastoManiac