outputting constantly in the same place.

Im new to c++. Just trying to make a program where you can rate something out of ten and the total adds until the loop ends.
I was just wondering how to output the overall total of the rating added to the score in one place(so it changes in one place). eg top right hand of screen.
sorry if i sound like a mugchesse.
here is my code:

[b]#include <iostream>
#include <cstdlib>
using namespace std;
int scoreadd(int total, int rate) {
do {

cout << "rate person between 1 and 10" << "\n";
cin >> rate;
if(rate > 10)
cout << "You must rate between 1 and 10" << "\n";
else
total = rate + total;
}
while
(total < 100);
cout << "Score limit reached";

return(total);

}

int main() {
int student;
student = scoreadd(0,0);
cin >> student;
system("PAUSE");
return(0);
}
[/b]
Last edited on
So your making a console app? Oh and BTW replace that system("pause") in there with somthing like cin.ignore().
how come??
and yes i am making a console app although i dont really know what that means!
you can use the ncurses C library

but if I were you, I'd focus on learning more basic things in C/C++ until you understand at least intermediate level C - then you can try ncurses
ok thanks, but could you explain about the ncurses library?
system("pause") is fine for just messing around with code, but there are better cross-platform functions that work just as well.

http://cplusplus.com/forum/beginner/1988/
Last edited on
Topic archived. No new replies allowed.