Ok. So I'm reading C++ Without Fear, and I have to say so far I'm enjoying the book. However, this thread isn't for a book review. I've been using Dev-C++ to compile and run all the example programs in the book and so far it has worked perfectly. Until I got to this program:
Code:
#include <iostream>
#include <string.h>
using namespace std;
int main() {
char str[600];
char name[100];
char addr[200];
char work[200];
// Get three strings from the user.
cout << "Enter name and press ENTER: ";
cin.getline(name, 99);
cout << "Enter address and press ENTER: ";
cin.getline(addr, 199);
cout << "Enter workplace and press ENTER: ";
cin.getline(work, 199);
// Build the output string and then print it.
strcopy(str, "\nMy name is ");
strcat(str, name);
strcat(str, ", I live at ");
strcat(str, ",\nand I work at ");
strcat(str, work);
strcat(str, ".");
cout << str;
return 0;
}
The compiler doesn't seem to have a problem with this. The linker does however. It comes back with this message:
g++: c:\documents and settings\owner\my documents\untitled1.o: No such file or directory
g++: file path prefix `C:\DEV-C_~1\Bin\' never used
Anyone have a clue as to what I'm doing wrong?