Gill,
you would want to declare a string object in main also
#include <iostream.h>
#include <string> // C++ standard string class
void GetInput(string &); // Function Prototype
int main()
{
// sting object definition, initialized with Peter
string word (Peter);
cout << "Original word:" << word << endl;
GetInput(&word);
cout << "Finally:" << word << endl;
return 0;
}
|