I have a question about C and C++

Started by
10 comments, last by vageta 24 years ago
C and C++ can be used for making windows applications.

Also note, thats Charles Petzold''s book, one of the best out there for windows programming books is entirley in C (at least the one i have is).

I suggest you learn C, then if you want to, you can learn C++. But, since programmers need to know more than one language, starting in C and then learning C++ gives you claims to two languages, not just one.
Advertisement
C++ is a super set of C (meaning it has everything that C has and more). I learned C first and i think this was probably the better way to go for me because you get to learn everything from under the hood before you implement it with C++ so you know what is going on. You can do all of the object oriented stuff in C before you move to C++ and then C++ basically makes it easier.
ex:
// In C a first class list adt
typedef struct _LIST_HEAD{
NODE * List;
}LIST_HEAD,*PLIST_HEAD;

PLIST_HEAD IntializeListHead();
void Insert(PLIST_HEAD Head,void * Object);
void * Delete(PLIST_HEAD Head,int Index);
void TerminateList(PLIST_HEAD Head);

//In C++
typedef class _LIST_HEAD{
_LIST_HEAD();//constructor which initializes the head
~_LIST_HEAD(); //destructor which terminates the head
void Insert(void *Object); //Method for inserting
void Delete(int Index); //Method for deleting
}LIST_HEAD,*PLIST_HEAD;

//C++ keeps it all in once nice package for you to use
C++ gives you a better structure to think object oriented
but it looks very familiar to C. Good luck in learning C++ and have fun.

--Fuel

I dream in Black and White.
Founder Caffeinated Gameswww.caffeinatedgames.com

This topic is closed to new replies.

Advertisement