| Click here to select a new forum. |
| C++ 'vector' question - System 7 |
Posted by: feeef on 2013-01-19 13:25:12 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 :
#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!
|
Posted by: ClassicHasClass on 2013-01-19 15:34:59 ITYM #include (note no .h).
|
Posted by: bd1308 on 2013-01-20 15:51:53 It's talking about the 'vector template argument' -- ie you have to do a #import too
|
Posted by: feeef on 2013-01-21 01:40:18 Thanks for your answers!
I do :
#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......
|
Posted by: ClassicHasClass on 2013-01-21 08:37:30 What CodeWarrior is this, again? It might be using a different version of the standard.
|
Posted by: feeef on 2013-01-21 09:26:25 It is CodeWarrior Professional Release 1 with IDE v 2.0.
Maybe, I should try to get another version ?
|
Posted by: ClassicHasClass on 2013-01-21 18:37:14 Yeah, I suspect that version's STL isn't (fully) C++98 compliant.
|
Posted by: feeef on 2013-01-22 02:41:16 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!
|
| 1 |