P
Pinnerite
I'm actually trying to get back in after many years stuck in the past.
Below is code from a test routine intended to solve my technical mistakes:
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string myfilename = "";
string getfilename(); // error message 1
string getfilename(myfilename); // error message 2
return 0;
}
string getfilename(string myfilename)
{
myfilename = "success";
return myfilename;
}
Error messages
1) std::string getfilename' redeclared as different kind of symbol
2) error: previous declaration of 'std::string getfilename()'
I would be grateful for corrections. My tutorial doesn't seem to cover it.
Below is code from a test routine intended to solve my technical mistakes:
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string myfilename = "";
string getfilename(); // error message 1
string getfilename(myfilename); // error message 2
return 0;
}
string getfilename(string myfilename)
{
myfilename = "success";
return myfilename;
}
Error messages
1) std::string getfilename' redeclared as different kind of symbol
2) error: previous declaration of 'std::string getfilename()'
I would be grateful for corrections. My tutorial doesn't seem to cover it.