|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
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 |
|
|
|
|
|
#2 |
|
Member (10 bit)
|
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
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|