Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gcc and OOP 1

Status
Not open for further replies.

Chacalinc

Vendor
Joined
Sep 2, 2003
Messages
2,043
Location
US
Hi,
I'm new on gcc on linux. I tried a C program with class, but I got errors. Example:

class rect{
int x,y;
set_values(int, int);
int area (void) { return(x*y); };
}

and I get:
error: parse error before "rect"
error: syntax error before '{' token
... and others.

does gcc support OOP?

Danke.
 
gcc is for C programs.

You're trying to write a C++ program.

g++ is the equivalent of gcc for C++ programs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top