D
David Hutto
In the following I would like to know how I can convert the cin(in
getline, or using cin directly) for function into a type that uses the
variable 'function', with an actual call to the function display?
So if I enter display ("string here") at the cin prompt it will call
display() and cout string a.
#include <iostream>
#include <string>
using namespace std;
int display (string a)
{cout << a;}
int main()
{
string function;
cout << "< ";
getline(cin,function);
function;
return 0;
}
Thanks,
David
getline, or using cin directly) for function into a type that uses the
variable 'function', with an actual call to the function display?
So if I enter display ("string here") at the cin prompt it will call
display() and cout string a.
#include <iostream>
#include <string>
using namespace std;
int display (string a)
{cout << a;}
int main()
{
string function;
cout << "< ";
getline(cin,function);
function;
return 0;
}
Thanks,
David