Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Need help with a string function call

$
0
0
Hi,

I'm just beginning to learn how to code in C++ after having taken college classes on Visual C# and Java. I have a bit of a predicament that I would like help with if at all possible.

I am using a book called "C++ for Dummies, Second edition" that was written and published in 2008. I am trying to call a string function in my main function from a seperate file using a header (include "somestuff.h" for instance). My compiler recognizes the header and the function but for some reason I can not output the result to console. Here's my code and the error.

#include <iostream>
#include "somestuff.h";

using namespace std;

int main()
{
cout << "Surprise, surprise!" << endl;
cout << "The combination is (once again)" << endl;
cout << SafeCracker(12) << endl;

return 0;
}

Error: no operator "<<" matches these operands

I've been getting the same error across two compilers, one of which is Visual Studio 2010 and the other being the latest version of Code Blocks. I know the solution is probably relatively simple, so any help would be much appreciated.

Thanks!





Viewing all articles
Browse latest Browse all 2703

Trending Articles