Thursday, July 30, 2009

Questions about system ("CLS") c++?

Hi guys its me again!





Another question , in my program there is a place where i would like to clear the screen and re display the main menu.





i have been using system("CLS"); and underneath it the call for my main function basically like this:





system("CLS");


mainMenu();





so that works in most cases but not in this one place because it is reading in from a file the user types the name of the file and it displays in the console but when I place the above code there after the user enters the name of the file it doesnt it displays the text from the file but really fast and skips to the sytem ("CLS"); but doesnt display the menu again and just leaves me with the press any key to continue and then i press a key and the program exits.





I have used the system("CLS"); and mainMenu(); combo before in other place and it works and I can only assume that it has something to do with the file being outputted to the screen so any ideas? is there another way to do what I want without system("CLS")

Questions about system ("CLS") c++?
When you have questions about your code, post code that is relevant to your problem… Actually just post on http://cboard.cprogramming.com/ . In any case, the problem isn’t file i/o, but that something is being left in the standard input buffer. Probably a newline. I can’t diagnose the exact problem without seeing the code you wrote. Don’t post it here, post cboards. Reading unformatted code is annoying.





Edit:


Ooh, it looks like I answered your previous question. Now I really would bet my money on the newline being left in the buffer. Did you read my previous answer?


No comments:

Post a Comment