Hi. I am a newbie to c++ (and general programming). I am using the book c++ for dummies all in one guide. I am having problems compiling a code with headers. I have taken the code straight from the book and it still wont compile.
This is the code:
main.cpp
include <cstdlib>
include <iostream>
include <stdlib.h>
include <string>
include "safestuff.h"
using namespace std;
int main(int argc, char *argv[])
{
cout << "Surprise, surprise!" << endl;
cout << "The combination is (once again)" << endl;
cout << SafeCracker(12) << endl;
system("PAUSE");
return 0;
}
Hi. I am a newbie to c++ (and general programming). I am using the book c++ for dummies all in one guide. I am having problems compiling a code with headers. I have taken the code straight from the book and it still wont compile.
This is the code:
main.cpp
include <cstdlib>
include <iostream>
include <stdlib.h>
include <string>
include "safestuff.h"
using namespace std;
int main(int argc, char *argv[])
{
cout << "Surprise, surprise!" << endl;
cout << "The combination is (once again)" << endl;
cout << SafeCracker(12) << endl;
system("PAUSE");
return 0;
}
safestuff.cpp
include <string>
using namespace std;
string SafeCracker(int SafeID) {
return "13-26-16";
}
safestuff.h
string SafeCracker(int SafeID);
has anyboy got any idea what i am doing wrong. any help would be appreciated.
Your format is all wrong. Why do you want to crack safes? Prison is no fun.