Help: Searching string for characters

So my assignment is to search an inputed DNA string for the characters "A G T C" using a bool function but no matter what I try, I cannot get the string find function to work.

[code]
#include <iostream>
#include <string>

using namespace std;

string enterDNAString(string DNAsequence)
{
cout << "Enter DNA sequence: ";
cin >> DNAsequence;
cout << "Your DNA sequence is: " << DNAsequence;
cout << " (" << DNAsequence.size() << " characters)";
return DNAsequence;
}

bool checkValidity(string s)
{
size_t pos = s.find_first_of("agtcAGTC");

if (pos != string::npos)
{
cout << " Valid DNA";
}
if (pos == string::npos)
{
cout << " Invalid DNA";
}
return 0;
}

int main()
{
string DNAsequence = "";
enterDNAString(DNAsequence);
checkValidity(DNAsequence);
return EXIT_SUCCESS;
}
string enterDNAString(string DNAsequence)

Should be :
string enterDNAString(string &DNAsequence)
Thank you, my code works now!
Topic archived. No new replies allowed.