does anybody here program in c++? or c?
i'm trying to learn but i can't figure out how to use the gcc compiler that i got from Apple's developer tools. I've read plenty and I know how it should work, but it just doesn't! I've used SimpleText and vi to write the files. i have been using .cpp as the file extension most of the time and the compiler will recognize the code that i write: the problem is that it always gives me error messages. and they're the most vague error messages too. i wrote and tried to compile this code:
#include <iostream.h>
int main{}
{
cout<<"Hello";
return 0;
}
and the error message i got was
"prog.cpp:2: syntax error before `{' token"
that's kind of vague
can anyone help me? is there something wrong with my code or is there something wrong with the way I'm using the compiler?
i'm trying to learn but i can't figure out how to use the gcc compiler that i got from Apple's developer tools. I've read plenty and I know how it should work, but it just doesn't! I've used SimpleText and vi to write the files. i have been using .cpp as the file extension most of the time and the compiler will recognize the code that i write: the problem is that it always gives me error messages. and they're the most vague error messages too. i wrote and tried to compile this code:
#include <iostream.h>
int main{}
{
cout<<"Hello";
return 0;
}
and the error message i got was
"prog.cpp:2: syntax error before `{' token"
that's kind of vague
can anyone help me? is there something wrong with my code or is there something wrong with the way I'm using the compiler?