Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Reply
Posted 2002-04-11, 07:37 AM in reply to spa's post "Just a question..."
Well yes, the most obvious difference is the OOP. In addition, C++ often requires an explicit cast (especially for pointers) where C does not. C++ allows you to declare variables anywhere in a function, whereas C requires all declarations to be at the top of the function. C++ has dynamic memory allocation with new and delete, which take object size and initialization into account, whereas in C, you have to use malloc and free, in which you have to specify a size in bytes, then cast it to the type you need. C++ allows function overloading, which allows you to replace pre-existing functions, and define several functions by the same name with different parameters or parameter types (so you could write an "int makeint(char*)" and an "int makeint(float)", and the compiler decides which one is best for your use of it), whereas C has none of this. C++ allows you to define operators, while C does not. There are a few other nit-picky things, such as use of constant variables in array size declarations, which I tend to forget, and are not terribly important.

So there you have it, an overview of the differences between C and C++
--WetWired
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 01:55 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.