Category : void

I want after taking input, the input function should return back to the next line of main() on which we called input(). But the return; exits the entire program. #include <iostream> using namespace std; void input(string str, string terminator) { if (terminator == "#") return; //what to change here? else if (getline(cin, terminator)) input(str+terminator, terminator); ..

Read more

In C/C++ there are two ways to declare a function that returns nothing. First one is to declare a function without arguments: // no arguments void f() { } The second one is to declare a function that takes void: // still no arguments void f(void) { } However, this is not true for the ..

Read more