• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

C++ 'vector' question - System 7

feeef

Well-known member
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 :

Code:
#include 

// ... and somewhere inside my method
vector arr;
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!

 

feeef

Well-known member
Thanks for your answers!

I do :

Code:
#include 
#include 

vector arr;
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......

 

feeef

Well-known member
It is CodeWarrior Professional Release 1 with IDE v 2.0.

Maybe, I should try to get another version ?

 

feeef

Well-known member
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! :p

Thanks for your help anyway ClassicHasClass!

 
Top