well I stumbled on a problem today with mixing c and c++..
dont want to know how many that will be in 4 years ^^
So you suggest that I pick up c++ instead? or keep learning some "basics" in c?
well I stumbled on a problem today with mixing c and c++..
dont want to know how many that will be in 4 years ^^
So you suggest that I pick up c++ instead? or keep learning some "basics" in c?
I don't think the issue is over your convention of programming. I think the problem is that you are using the C++ STL within the context of a "C" program. In other words, you are doing a C++ only thing in a C program. Ergo, your program is a C++ program.
C++ is different in that it allows one to write classes, inherit traits between objects, gives a more type-bound coding structure, and allows templates to be written (That is a very broad comparison, so please spare everyone pointless flaming that is just a narrowing of my description).
C++ is a different language. Would you think it odd if I had code like this:
You would be like dude, what is that? Some sort of crazy PASCAL, VB, C hybrid? Remember you can use C within a C++ program, but not the other way around.Code:float quadratic(float a, float b, float c, bool plus) { float descr := b*b - 4*a*c; quadratic := (plus)?(-b+sqrtf(descr))/(2*a):(-b-sqrtf(descr))/(2*a); }
Well if the diff. on c and c++ is so huge, why sit hours with that when in the long run I will get out more of c++?
or am I out on a road beyond my knowledge and understanding now? :P
ye wtf is that master 5001 ^^
Yeah, I ask myself the same thing.
But seriously, it depends on the target platform. Embedded systems, unfortunately, still are pretty much only C today.
But if you intend to target the PC/Mac market, then I would definitely say that C just won't cut it and C++ is the one for the job.
well, first.. what is a embedded system?
Too bad I bought books on c programming today then.
My point is simply, if you are writing in one language you typically do not arbitrarily introduce another at will. With C++ and C it is slightly since C++ is based on C. However you are clearly intending to write a C program.
I use C++ in embedded systems too... Though it depends on what sort of device it is. I personally tend to be more of a C kind of guy. Though its all the same to me. I will use whatever gets the task completed the swiftest. Even if its a tool I wrote in PHP or Python or whatever.
Now I understand why my friend is using C, he is working for some company that is working with dvd's etc.
well now I´m just confused, use c or c++.
I started off with c++ in the beginning, but then I got told to do some C, dunno why really.
I thought this might happen.
OK, what I proposed was - choose the language depending on what you want to do.
Do you want to work with mostly embedded systems (most embedded systems are C, some are C++, and some are just assembly)? If so, then you will probably have to learn C, and possibly C++ if any embedded systems you will work on will be using that.
Or maybe you want to work with computer software? If so, choose C++.
Well my goal is to work with computer software, so I supose I will go C++.
well the things I have learnt from C will not go to waste, some things is still the same. Or very alike
Then I have one more question.
c++ for dummies 2nd edition and so on, is it any changes on the editions?
I know there is like 7 pages on books, just maybe it is faster to ask here