|
-
January 11th, 2009, 04:47 AM
#7
Re: Two Dimensional Vector
 Originally Posted by Peter_APIIT
The error is
From this code
Code:
StringVector2D my2DArrayOfString(10, StringVector1D(20));
Thanks.
Please post a complete example!. How in the world can anyone tell you what the compiler error is without showing us all of the code?
Compiler errors can only be diagnosed when given all of the code. No one knows if you included everything, whether you spelled something wrong, whether you've missed a semicolon, or anything else. Just giving a single line where the error occurs is not enough. I'm surprised after all the posts you've done, you fail to do this very simple step of providing complete code to properly diagnose a compiler error.
The following compiles correctly in Comeau.
Code:
#include <vector>
#include <string>
typedef std::vector<std::string> StringVector1D;
typedef std::vector<StringVector1D> StringVector2D;
int main()
{
StringVector2D my2DArrayOfString(10, StringVector1D(20));
my2DArrayOfString[0][0] = "Test";
}
Note there is no difference in that one line of code between what I posted and what you posted.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|