Hello,
I am trying to declare a string array that looks like this
string quest[4000][30];
It will compile but everytime i run i get the error message
''An unhandled exception of type 'System.StackOverflowException' occurred in 3304.exe''
If i take the array from 4000 down to 362 it works but at 363 or higher i get the message. does anyone know why. also is there a way to take a line of text and have it start and stop at certain characters such as '<' and '>' and have it save that as a string in an array.
If you can help the first question is most important.
thanks
string array
Started by
Guest_norman_069_*
, Jun 18 2008 05:51 PM
5 replies to this topic
#1
Guest_norman_069_*
Posted 18 June 2008 - 05:51 PM
Guest_norman_069_*
|
|
|
#2
Posted 19 June 2008 - 06:54 AM
What are you doing that you need that big of a 2-dimensional array?
#3
Posted 19 June 2008 - 10:59 AM
creating an array of 120,000 strings is likely to use a LOT of memory.
#4
Guest_norman_069_*
Posted 19 June 2008 - 03:46 PM
Guest_norman_069_*
ok i figured out the stack error but now i need to know about the string and the character with in the string. I need a way to read a sentence like <aaaa>bbbb</cccc> with no spaces and be able to seperate it using the charachters < and >. so i get three string <aaaa> and bbbb and </cccc>.
let me know if you can help
thanks
let me know if you can help
thanks
#5
Posted 19 June 2008 - 05:01 PM
You should create a char array instead of a string array.
Then you could use strtok() for splitting each array.
Then you could use strtok() for splitting each array.
#6
Posted 22 June 2008 - 05:18 PM
You could also use scanf to split the array much faster. For example:
scanf("<%s>%s</%s>",str1,str2,str3);
scanf("<%s>%s</%s>",str1,str2,str3);


Sign In
Create Account

Back to top










