Well, I've been programming in most basic environments, VBasic 4/5/6... Delphi 5... and now I'm approaching MSVC++ and I'm facing some troubles understanding arrays...
well, let's get to the point, in most languages, for example in vb, I could declare an array without specifying the exact size, and then use Redim ArrayName(newsizes) to redim it. Optionally I could use the Preserve keyword to avoid clearing the array after redim.
How do I make a redim-able array in MSVC++ ???
this code
int myint[];
produces a error C2133: 'mod' : unknown size
also, If I use it in a class interface definition, it does not produce errors, but just a warning
warning C4200: nonstandard extension used : zero-sized array in struct/union
So I've been looking in the help and some other guides, and I have the feeling that a possible solution would be using malloc, or the "new" operator... but since I got my mind messed up with that stuff, I'll wait for you Gurus to tell me your opinion.
Thanx in Advance.
well, let's get to the point, in most languages, for example in vb, I could declare an array without specifying the exact size, and then use Redim ArrayName(newsizes) to redim it. Optionally I could use the Preserve keyword to avoid clearing the array after redim.
How do I make a redim-able array in MSVC++ ???
this code
int myint[];
produces a error C2133: 'mod' : unknown size
also, If I use it in a class interface definition, it does not produce errors, but just a warning
warning C4200: nonstandard extension used : zero-sized array in struct/union
So I've been looking in the help and some other guides, and I have the feeling that a possible solution would be using malloc, or the "new" operator... but since I got my mind messed up with that stuff, I'll wait for you Gurus to tell me your opinion.
Thanx in Advance.