C++ Problem

This is a discussion on C++ Problem within the C++ Programming forums, part of the General Programming Boards category; I've been trying to figure this out for the past 6 hours. When you run this program, lander.exe, (you may ...

C++ Problem

I've been trying to figure this out for the past 6 hours. When you run this program, lander.exe, (you may download it at http://jprotege.com/c2) in dos with the command line "lander.exe sonic 100", the program outputs text, but does not output the O's . I believe a function is not being called properly in lander.cpp

I believe the problem is in lander.cpp

What can I add to my code to make the O's output onto the screen when I run the lander.exe in dos?

My project is this:
You have to produce a program that automatically navigates a lunar module lander down an increasingly narrow canyon in the lunar surface. Note that this means that there is no interactive keyboard input, and the lander moves entirely under program control. The progress of the lander is output in the following format, with the canyon walls represented by the "O" character and the landing pod by"V"

Remember, too, that the board has a search facility, a link is at the top of your screen:http://cboard.cprogramming.com/search.php
It will often get you a quicker answer to your questions than waiting for a response to one you have posted.

It appears that you are posting a homework assignment or other project.

Please don't ask people to do all your work for you, See the announcement on Homework at the top of all forums to see what is acceptable or PM me. Basically people are happy to help, but they're not going to do it all for you.

Show us what you've got, show your code (using code tags), or where you're confused and someone will be happy to help you I'm sure. If it's something that you absolutely don't understand how it works, like you have no clue how qsort works, then ask a general question about the function and I'm sure someone will explain it. Though they may not give you all of the code for it, but someone will explain the concept.

On obivous homework questions especially, I like to remind people of the board's ninth guildeline, while this board is very helpful to people, make sure you have your instructor's permission before seeking help on assignments. While people on these boards are more than happy to help, we discourage people from asking for help on graded work without the instructor's permission, and we claim no repsonsibilty for any cheating or honor violations.

I ran this in the UNIX system at school:
g++ lander.cpp -o lander.exe
lander.exe
segmentation fault (core dumped)

I also tried:
g++ lander.cpp -o lander.exe
lander.exe sonic 100
AHH!!Please remember to enter a speed of either Crawl, Slow, Medium, Fast, Sonic
Please also remember to enter a fuel amount that is not a negative number

If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein