[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
c code vs c++ code
- To: email@example.com
- Subject: c code vs c++ code
- From: Jason Stechschulte <firstname.lastname@example.org>
- Date: Sun, 24 Nov 2002 06:01:21 -0500
- Delivered-To: email@example.com
- Delivered-To: mailing list firstname.lastname@example.org
- Delivery-Date: Sun, 24 Nov 2002 06:01:32 -0500
- Mailing-List: contact email@example.com; run by ezmlm
- Reply-To: firstname.lastname@example.org
- Sender: Jason Stechschulte <email@example.com>
- User-Agent: Mutt/1.4i
The main reason I started trying to write games in Linux was to re-learn
C++. I hadn't used it since my University days roughly 5 years ago.
Now I'm feeling comfortable with it once again, so I started downloading
other open source games and looking through the source code.
I noticed that most games that are written using C++ code still use C
code for many things. Sometimes it is using printf instead of cout and
other times it is using something like:
FILE *fp = fopen( ... );
input.open( ... );
I'm wondering if there is some benefit to using the C code rather than
the C++ code. Is it possibly better for porting to other systems? Or
is it simply programmer preference?
Since there is a standard for C++, I would think that it is probably
because the programmer is more familiar with C and is used to using it.
I know that C code is normally faster than C++ code, but I wouldn't
think that file handling would be something that needed to be highly
optimized for speed.
Dying is a very dull, dreary affair. My advice to you is to have
nothing whatever to do with it.
-- W. Somerset Maughm, his last words