C
Chris
I'm compiling the following code with GCC 4.1.0 (on fedora 6 I think).
It compiles fine, then when I run it it simply prints "segmentation
fault".
int main() {
vector<vector<string> > yo;
yo[0][0] = "hello";
cout << yo[0][0];
return 0; }
1. What's causing this?
I'm using the object "vector<vector<string> >" so I can split a string
into lines, then split the lines into words so that
"hello there\nTommy Boy"
becomes
[ ["hello", "there"], ["Tommy", "Boy"] ]
2. Should I do this a different way?
Thanks for any help!
It compiles fine, then when I run it it simply prints "segmentation
fault".
int main() {
vector<vector<string> > yo;
yo[0][0] = "hello";
cout << yo[0][0];
return 0; }
1. What's causing this?
I'm using the object "vector<vector<string> >" so I can split a string
into lines, then split the lines into words so that
"hello there\nTommy Boy"
becomes
[ ["hello", "there"], ["Tommy", "Boy"] ]
2. Should I do this a different way?
Thanks for any help!