Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-2008, 09:51 PM
norman_069 norman_069 is offline
Newbie
 
Join Date: Sep 2007
Location: Houston
Posts: 17
Rep Power: 5
norman_069 is on a distinguished road
Default string array

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-19-2008, 10:54 AM
MeTh0Dz MeTh0Dz is offline
SLICE OWNZ YOUR SOUL
 
Join Date: May 2008
Posts: 294
Last Blog:
Ternary Operator CPP
Rep Power: 0
MeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura about
Default Re: string array

What are you doing that you need that big of a 2-dimensional array?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-19-2008, 02:59 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,421
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default Re: string array

creating an array of 120,000 strings is likely to use a LOT of memory.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-19-2008, 07:46 PM
norman_069 norman_069 is offline
Newbie
 
Join Date: Sep 2007
Location: Houston
Posts: 17
Rep Power: 5
norman_069 is on a distinguished road
Default Re: string array

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-19-2008, 09:01 PM
revealer revealer is offline
Newbie
 
Join Date: Jun 2008
Posts: 9
Rep Power: 0
revealer is on a distinguished road
Default Re: string array

You should create a char array instead of a string array.
Then you could use strtok() for splitting each array.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 06-22-2008, 09:18 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: string array

You could also use scanf to split the array much faster. For example:
scanf("<%s>%s</%s>",str1,str2,str3);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with pointers and string array. C. Cheer C and C++ 2 03-19-2008 08:00 PM
SecurityAudit vinay Visual Basic Programming 27 01-07-2008 01:14 PM
[SOLVED] Find string in array mevets Python 1 10-09-2007 10:38 PM
Is string in array? smith Perl 2 02-14-2007 02:30 PM
Accessing a string by array Saint C# Programming 3 10-03-2006 08:33 PM


All times are GMT -5. The time now is 11:47 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads