Thank you for answering my question declaring the function through "void" didn't work but I changed it to "int" and it worked with you string modification thank you
just for fun:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <string>
#include <iostream>
usingnamespace std;
int add (string a, string b)
{
cout << "a + b = ";
cout << a+b ;
cout << " Success";
return (0);
}
int main ()
{
add("the","1");
cin.get();
return 0;
}
If you don't need functions to return anything, make their return type void:
1 2 3 4 5 6 7 8 9
void emailFriend (string buddy)
{
cout << "Hello, ";
cout << buddy ;
cout << " hows it going today?" << endl;
//Note: For a void function, there's no need for return just before the closing brace.
//It doesn't hurt, though.
return;
}
This doesn't apply to main(), which should always return int.