C++ Tutorial
Hi,
I am trying to learn C++. But I cannot seem to get the most basic program compiled. I say #include < stdio.h > and it says it cannot find it when compiled with gcc or cc. if I do whereis stdio.h it says /usr/include/stdio.h if I put the full path in the include statement, I get the same error. Someone please help. David |
it should be:
Code:
#include <stdio.h> The full path will never work with <>, you'd want to just use "". If it still doesn't compile, you might have to specify -I/usr/include, though you shouldn't have to. |
Quote:
the < and > ? Cheers, Tink |
You seem to be using C header files instead of C++. In C++ a simple hello world app would be similar to the one below.
#include <iostream> using namespace std; int main (void) { cout << "Hello, World!\n"; return 0; } |
Use #include <cstdio> instead of #include <stdio.h>
If I'm right, stdio is deprecated. |
All times are GMT -5. The time now is 10:42 AM. |