Sorry for the page stretch. OK my program is shutting down mid-program and giving me the errors below, How would I go about fixing it?
'projecttwo.exe': Loaded 'C:\Users\T_Dub\Documents\Visual Studio 2010\Projects\projecttwo\Debug\projecttwo.exe', Symbols loaded.
'projecttwo.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'projecttwo.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'projecttwo.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'projecttwo.exe': Loaded 'C:\ProgramData\Norton\{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\N360_20.1.0.24\Definitions\BASHDefs\20130502.001\UMEngx86.dll', Cannot find or open the PDB file
'projecttwo.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'projecttwo.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
First-chance exception at 0x75464b32 in projecttwo.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0104f788..
Unhandled exception at 0x75464b32 in projecttwo.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0104f788..
Huh? It was already displaying the values that was being sent. I added a cout for the move counters and it printed out two valid moves and 10 invalid. Same type of numbers being sent the first 12 times it goes through the loop. I don't see how that would mess something up but, then again I don't really understand the out_of_range error to begin with lol.
*EDIT* So, the error is at memory location 0x0104f788, right? I don't understand that number. How do I find it?
On line 73, are you sure that moves.direction.at(0) actually exists? What if there are no elements? If there are no elements, .at(0) will throw the out of bounds exception.
Sorry, I meant moves.direction.at(1) - if the string is just "L" then there is no second character. I don't think you're using short-circuit evaluation properly.
No there is no character at moves.direction.at(1) but I have if (moves.direction.length() == 2) At Line 84 before I check for moves.direction.at(1). Does that not cover for it?
Short-circuit evaluation? I'm not sure what that is. Is there a page here that explains it? I just kind set up the if loops from scratch.
Ahh! I see but I need it to check both of them together. Or can I put a preliminary check and separate them?
Would something like this work?
1 2 3 4 5 6 7 8 9 10
if One{
Valid = Movement Valid
Invalid = Movement Invalid
}
if Two{
Both Valid = Movement Valid
One Invalid, One Valid = Movement Invalid
Two Invalid= Movement Invalid
}