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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c or c++ faster

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
On a Unix/Linux box which language is faster, c or c++. Considering both higly optimized code(no stl, or templates), compiling with gcc/g++, and having the programs both performing the same thing.
 
I really don't have a clue but I would go with C. I would think it would go faster but I really don't know.
 
Hi,

That all depends on who's cutting the code! In theory, everything else being equal, C must be more efficient that C++ because there is more overhead with C++ due to the object oriented approach and richer functionality. Basically, the further you get away from assembler the more overhead there is in calling standard libary functions, etc., etc. Lets put it another way - the linux kernel is written in C not C++.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top