November 20th, 2010, 12:53 AM
Help Solving Maze using pointers and Search
Ive written a program that takes a txt file and reads in a maze.. My approach is not the best.. However, im really close to being done. I can't figure out how to get my search function to be equal to the place in the array.
im trying to set current to what i return in the searchArray function.
November 20th, 2010, 10:22 AM
Re: Help Solving Maze using pointers and Search
Why didn't you use container classes such as std::vector or std::list instead of trying to code your own? You've turned the maze problem into a linked list/dynamic array maintenance problem.
Originally Posted by ryan33m
Secondly, your code leaks memory all over the place. You are really not close in completing the problem, until you take care of all of these memory leaks. You call "new" without calling "delete" one time in your entire code. You can't write C++ code that allocates memory, and then not write code to deallocate that memory properly.
Third, have you used the debugger to solve your problem? If you wrote the code, you must be able to debug your own code. If you have used the debugger, where have you observed your program not behaving correctly?
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!