I am refreshing my self on C++ (have not did it since school) and I wrote a simple program just to mess around. My problem is when I compile the program it chokes stating "error: expected initializer before 'stringThing'" is there a reason why this is doing this? I know this may be a noob question so I checked stackoverflow and could not find any relevant questions that gave me a answer.
*I am using GNU GCC compiler
Code:
#include <iostream>
using namespace std;
void string stringThing (string shiftdir, string &teststring)
{
if (shiftdir == "right")
{
teststring = teststring >> " " >> "Bit Shifted right";
}
else
{
teststring = teststring << " " << "Bit Shifted left";
}
}
int main()
{
string test;
cout << stringThing("right", "I have done a ") << endl;
return 0;
}