Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-27-2003, 04:51 PM   #1
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
C++ command for...

here is the situation. I am designing a word search program. I think there is a command to break out of a loop and continue w/ the function(exit it in this case). the function starts w/ a set of points from the wordsearch array. This particular function is searching horizontally and forward. here is what i have so far, just throwing out ideas:

(ignore the lack of sytax)

i and j are the points already found. they point to the same letter that the word starts with. size is the number of letters in the word. matrix is the actual 20x40 2D array of char.

HFsearch(i, j, size, matrix)

int x = 0
int match = 1;

while(x<=size)

[i]=[i]+1;
x++;

if word[x] == [i][j]

else if word[x] != [i][j]
exit loop?





I dont know if this will even work, but to go any farther i need the command to break out of a loop. this is where i am kinda stuck. if it matches, i need it to start the while loop over, but if it is wrong it needs to exit. right now if it is wrong i think it would be an infinite loop? I dont remember the command to get out of the loop.

oh yea, if you have any ideas or have done a program like this before, feel free to share ideas!

thanks ^dan
GSXdan is offline   Reply With Quote
Old 08-27-2003, 05:15 PM   #2
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
haha, i guess it couldnt be more obvious than break, huh? i found that, but if anyone has ideas about the search function, feel free to comment
GSXdan is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:05 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2