Originally Posted by
Cdrwolfe
Well here is the unworking prototype, i can't for the heaven of me think what should be done next.
A good stating place for "what should be done next" is to have code that if possible will compile.
This is an array of 100 strings. Not a string with a 100 characters. Is that what you really want?
If it is then you need to use it with an index of the string you want.
Code:
cin >> done[index];
Maybe just.
Then this will be fine.
You should also remove the "semicolon".
Code:
string Finish(string thedone);
to
Code:
string Finish(string thedone)//; remove semicolon
Here you need a semicolon and remove the word string.
Code:
getline(cin, string done, '\n')
to
Code:
getline(cin, /*string*/ done, '\n');//add semicolon
You might want to add this to your function "Finish".
Code:
//for testing take note of the output?
//cout<<"You just entered : " << done << endl;
This will let you see that you are not getting the input you expect.
You also need to add a brace to the end of your function "Finish".
Code:
cin.ignore();
}
}// Add missing brace
I did not point out every change needed to make it compile. But the below code has them. Make of this what you will.
Code:
# include <iostream>
//# include <stdio.h>
# include <string>
using namespace std;
int Sequence()
{
int Sequence;
cout << "Input Residue Sequence: "<< endl;
cin >> Sequence;
cin.ignore();
cout << "Sequence entered: "<< Sequence <<"\n";
return 0;
}
string Alldone()
{
string done/*[100]*/;
cout <<"All Done!"<< endl;
cin >> done;
cin.ignore();
cout << "Done: "<< done <<"\n";
cin.ignore();
return done;
}
void /*string*/ Finish(string thedone)//; remove semicolon
{
string done;
getline(cin, /*string*/ done, '\n');//add semicolon
//for testing take note of the output?
//cout<<"You just entered : " << done << endl;
if(done == "Yes")
{
cout<<"Finished";
cin.ignore();//add semicolon
}
else
{
cout<<"continue?";
cin.ignore();
}
}// Add missing brace
int main(/*int argc, char* argv[]*/)
{
Sequence();
string var1 = Alldone();
Finish(var1);
cin.get();
}