User created function

I have the function get_value and if someone enters a negative number it will cout "The value must be non negative. Please try again." Instead of "Return 0;" I need to go back to the beginning int input. Is there a "return to the beginning" kind of pointer in c++? What would be the best method to have it start again?

int get_value()
{
int input;
cin >> input;
if (input < 0) cout << "The value must be non negative. Please try again.";
return 0;
}
Use a loop.
Topic archived. No new replies allowed.