Thread
C++ 'vector' question - System 7
Hi,
I have a technical question about C++ coding. I don't know if it's the best place to ask this kind of thing here but I know that some of you are expert in classic programming so I ask!
In my effort to do a JSON lib for our old macs running 7+ systems, I ended up with a problem and I cannot find a solution.
What I want to do is create an empty Array and make it grow by appending new elements to it (I don't know how many elements). At the moments my elements are just strings and I try to declare a vector for that purpose :
But I always end up with an error saying "illegal template argument(s)" pointing me to the closing '>' character.
I am still learning and maybe vectors are not the best way to do what I want to do so I am open to any good advice!
I have a technical question about C++ coding. I don't know if it's the best place to ask this kind of thing here but I know that some of you are expert in classic programming so I ask!
In my effort to do a JSON lib for our old macs running 7+ systems, I ended up with a problem and I cannot find a solution.
What I want to do is create an empty Array and make it grow by appending new elements to it (I don't know how many elements). At the moments my elements are just strings and I try to declare a vector for that purpose :
Code:
#include
// ... and somewhere inside my method
vector arr;
I am still learning and maybe vectors are not the best way to do what I want to do so I am open to any good advice!
ITYM #include (note no .h).
It's talking about the 'vector template argument' -- ie you have to do a #import too
Thanks for your answers!
I do :
Unfortunately the result is the same.
I tryed vector arr; but always end up with the same compilation error.
I also tryed to use 'map' for associative arrays in some earlier code but it looks like my compiler doesn't like the '<>' template syntax at all.
I am trying to find a code example using vector on pre-OS 8 systems. Maybe the syntax has changed since then......
I do :
Code:
#include
#include
vector arr;
I tryed vector arr; but always end up with the same compilation error.
I also tryed to use 'map' for associative arrays in some earlier code but it looks like my compiler doesn't like the '<>' template syntax at all.
I am trying to find a code example using vector on pre-OS 8 systems. Maybe the syntax has changed since then......
What CodeWarrior is this, again? It might be using a different version of the standard.
It is CodeWarrior Professional Release 1 with IDE v 2.0.
Maybe, I should try to get another version ?
Maybe, I should try to get another version ?
Yeah, I suspect that version's STL isn't (fully) C++98 compliant.
This version is from 96 or 97 so it should be too old to be C++98 compliant. I will try to get a later version then. It's not gonna be easy I gess!
Thanks for your help anyway ClassicHasClass!
Thanks for your help anyway ClassicHasClass!