HI
im leraning c right now so i just ask if i can program in c or i need to learn c++ to use engine?
C or C++ Please Help
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
I agree in that "play" mode it's pretty harmless and simple, however C++ isn't much more difficult to learn if you already know C. I personally started programing straight C++ using Irrlicht as my learning grounds.strale wrote:In my point of view
if you know C
and you just want to play around the HelloWorld tutorial
you do not need to be a C++ wizard
I never ran into any major problems, no major hardware glitches, no segfaulting, and if there ever were memory leaks they never caused issues either. I did all of this without even knowing how a debugger worked, without knowing much at all, in that time I didn't know about any of that stuff.
Today I love C++ because it wasn't hard to learn the basics, I don't even come from a geeky background, I'm was a tinker nut as a kid, I would take toasters and vcr's apart when they were broken.
If I look back now I could have done it all in a couple months of work.
goodluck, happy coding!
I keep forgetting what I wanted to say.. C and C++ shouldn't be mixed heavily, you can get away with it inorder to play and learn, but it's bad programing practice. Irrlicht is written in C++ and to my understanding if you wanted to use C on top of that you need to register it all in the OS so it functions properly. I'm thinking extern commands and some other bit.
So ultimately the answer is: Go learn C++ if you expect to use this engine, C hasn't been used much in a long time on most things, it's time to evolve.
I agree with most of what you said. C++ is mostly just a superset of C, so if you know C, C++ will be easy. My only contention:
While this is generally true, there's circumstances where you'll want to mix C and C++. For example, when you build a dll, you can export your functions in C to avoid all the C++ name mangling. Or, say you need to integrate your C++ code with older system code in C (the Windows API does this all the time). It's not very hard to use extern commands at all... I'm not sure what you mean by registering it with the OS. I'd disagree that it's bad programming practice - doing it unnecessarily is dumb, but sometimes there's a need.Midnight wrote:I keep forgetting what I wanted to say.. C and C++ shouldn't be mixed heavily, you can get away with it inorder to play and learn, but it's bad programing practice. Irrlicht is written in C++ and to my understanding if you wanted to use C on top of that you need to register it all in the OS so it functions properly. I'm thinking extern commands and some other bit.
Seriously? There is absolutely no reason at all to avoid calling C code from C++ code. As a matter of fact, it is difficult to even write a C++ application that does anything useful without interfacing with a C library. Most modern operating systems expose their interfaces as C functions. On most platforms can't access files, sockets, graphics, databases, ... without accessing a C library at some level.
Travis
Travis