C versus C++
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
C++ is a superset of C. C is probably harder, if you don't know any really low level languages.. C++ is probably better for beginners. you can do a lot more in C++ before you have to get into the nasty parts (pointers and such). with C, there really isn't much besides the nasty stuff. they are equally powerful, in the right hands - as is pretty much every well known language. or, if you want to learn C++ but avoid the nasty stuff altogether, try Java or C#. my $0.02 -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
-
C++ is a superset of C. C is probably harder, if you don't know any really low level languages.. C++ is probably better for beginners. you can do a lot more in C++ before you have to get into the nasty parts (pointers and such). with C, there really isn't much besides the nasty stuff. they are equally powerful, in the right hands - as is pretty much every well known language. or, if you want to learn C++ but avoid the nasty stuff altogether, try Java or C#. my $0.02 -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
C++ is easier to learn only if you take the right approach. Unfortunatelly, there are too many C++ books that try to teach you C first, and then to add C++ specific stuff. This way they make C++ harder to learn. I vote pro drink :beer:
-
C++ is easier to learn only if you take the right approach. Unfortunatelly, there are too many C++ books that try to teach you C first, and then to add C++ specific stuff. This way they make C++ harder to learn. I vote pro drink :beer:
right. C makes C++ hard. and if you take the C out of C++, you get Java or C#. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
-
right. C makes C++ hard. and if you take the C out of C++, you get Java or C#. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
"and if you take the C out of C++, you get Java or C#." I don't think so. In C++, you still have templates, MI, default args. I vote pro drink :beer:
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
Hi Hassan, Differences: There are many, but the most significant one is that C is procedural and C++ is object oriented. Recommended: It's a matter of opinion, but I recommend C++. More Powerful: Depends on what that means. I say C++ is more powerful because it has a lot more features. Pros/Cons: For C: (pros) nice syntax (cons) it's procedural and forces you to deal with complex constructs. For C++: (pros) tons of features starting with OO (cons) you can ignore its benefits and use it like C. Better: It's a matter of opinion, but I prefer C++. Harder: Depends on your experience with OO. If nil, then C++ is harder. Again, this is my opinion. Check out Deitel's book on C++. It's great for beginners; in fact I think it's used by many universities. Regards, Alvaro
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
Learn C and C++ will follow... C++ is probably the most powerful language *today*. There are good books to buy. The best the to do with any language is to pick a nice project to develop and the rest will follow. I dug in deep with windows straight 'C' and emulated the Apple Mac puzzle game.
-
Learn C and C++ will follow... C++ is probably the most powerful language *today*. There are good books to buy. The best the to do with any language is to pick a nice project to develop and the rest will follow. I dug in deep with windows straight 'C' and emulated the Apple Mac puzzle game.
Is cout C or C++ ? What about printf ?
-
Learn C and C++ will follow... C++ is probably the most powerful language *today*. There are good books to buy. The best the to do with any language is to pick a nice project to develop and the rest will follow. I dug in deep with windows straight 'C' and emulated the Apple Mac puzzle game.
... then got my head around UML and design patterns, GUI design there's so much to learn for a trainee programmers. Pratice makes perfect... See the storm set in your eyes, see the thorn twist in your side, I'll for you. Slight of hand and twist and of fate, on a bed of nails she makes me wait, and I'll wait without you. With or without you... Bono (U2)
-
Is cout C or C++ ? What about printf ?
I believe cout is C++ based and included with the iostream.h, actually in C++ this would be >iostream< header, and printf is C based included in the stdio.h header. But don't quote me :-) I have been using MFC for so long I couldn't tell you which functions are in which library since MFC seems to include them all by default :-) Sam C ---- Systems Manager Hospitality Marketing Associates
-
I believe cout is C++ based and included with the iostream.h, actually in C++ this would be >iostream< header, and printf is C based included in the stdio.h header. But don't quote me :-) I have been using MFC for so long I couldn't tell you which functions are in which library since MFC seems to include them all by default :-) Sam C ---- Systems Manager Hospitality Marketing Associates
What is MFC ? I know that it stands for Microsoft Foundation Class but what does it do. BTW, can Java be compiled in to an exe ?
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
Adding my 2 cents here... A C++ compiler will compile most of what a C programmer codes - one small exception is stronger type checking on parameters (which drives us windows C++ coders to drink with all the casting we need to do - remember, Windows is a C API). C++ adds classes (the author, Bjarne Stroustrup, intended early on to call it 'C with Classes'), and more recently templates. I started the old fashioned way, learning C then moving to C++, but I think I'd point you to Andrew Koenig and Barbra Moo's book 'Accellerated C++'. Here you will come at things from a better angle, learning not only the mechanics of the language but an idiom of programming and leveraging the standard library that will take you more easily into advanced topics like generic programming. That said, I aint read it, eh. But looks to me like something worth having on the shelf.
-
What is MFC ? I know that it stands for Microsoft Foundation Class but what does it do. BTW, can Java be compiled in to an exe ?
You are right in that it stands for Microsoft Foundation Class what it is is a set of C++ classes to facilitate the writing of Window's based applications. Back in the old days in order to write a Windows application you had to write straight C code, it took an inordinate amound of code to just generate a simple "Hello World" type application, and that is with Windows handling all user generated messages. However, in MFC they help hide that from you, by utilizing classes, you don't even get to see WINMAIN :-) The one draw back to taking a higher level of abstraction is you don't understand how the underlining layer works. I wish all programming classes taught in school would start off with assembly, then work up from there, that way you can see which registers are flipping how bytes are moving, etc... Granted in the real world everything is based on money, and writing an assembly based application would take much longer than writing C, and C takes much longer than writing C++(MFC), etc... But I feel all programmers should at least have a general understanding of the underpinnings of the code, just a little bit of knowledge on what is going on "under the hood". Pretty soon not everyone will know how things work and Microsoft will have all the ASSEMBLY language programmers, and they'll have a monopoly on the market :-( I hope you get something from this and try to pursue a general understanding of what is going on when you type "printf" (not that I still remember, but it helps ;-) ) Just my two cents. Sam C ---- Systems Manager Hospitality Marketing Associates
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
C++ definately. A good book is Sams' Teach Yourself C++ in 24 Hours. After that you should look at a book on Win 32 or MFC or whatever because this book just teaches you C++. -Matt Newman :suss:
-
right. C makes C++ hard. and if you take the C out of C++, you get Java or C#. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
Don't think so. I am of the old school that requires one to have a level of understanding somewhat more specific than is the norm today. If you are a hobbist programer it makes little difference but if you are selling your skills you need to be on another level. Most C++ programmers today have little or no idea how windows ( or unix or linux ) really works, let alone a clear idea of how to code lean and mean. They can go on for hours discussing threads and messages without any clue about interrupts or task switching. C++ is a great language having a multitude of features but these come at a cost of code overhead that is really astounding. C is leaner but requires a bit more understanding on the programmers part of the underlying OS and demands a bit more care in use. Anything that one can do in C++ can be done in C. Maybe done differently but still accomplished and in many cases with less code and in almost all cases faster in execution provided the compilers are of equal quality. As a professional ptogrammer one owes it to himself and to his employer/customer to have a working knowledge of assembly language. Even if you never program in ASM it greatly facilitates debugging and streamlining of code and is needed to understand how the OS does its thing. A computer language is simpily a tool, nothing else. Just as there are certain tools for certain jobs there are languages for certain jobs. I wouldn't think about writing a compiler in VB for example but I would write a Database intensive program in it without any qualms. I wouldn't think about writing a voice recoginization system in C++ but would choose ASM and C. I would hate to think about writing a GUI in anything but C++ but I could if I had to. Remember the old joke: To someone with just a hammer everything looks like a nail. Get more tools :) Richard
-
Don't think so. I am of the old school that requires one to have a level of understanding somewhat more specific than is the norm today. If you are a hobbist programer it makes little difference but if you are selling your skills you need to be on another level. Most C++ programmers today have little or no idea how windows ( or unix or linux ) really works, let alone a clear idea of how to code lean and mean. They can go on for hours discussing threads and messages without any clue about interrupts or task switching. C++ is a great language having a multitude of features but these come at a cost of code overhead that is really astounding. C is leaner but requires a bit more understanding on the programmers part of the underlying OS and demands a bit more care in use. Anything that one can do in C++ can be done in C. Maybe done differently but still accomplished and in many cases with less code and in almost all cases faster in execution provided the compilers are of equal quality. As a professional ptogrammer one owes it to himself and to his employer/customer to have a working knowledge of assembly language. Even if you never program in ASM it greatly facilitates debugging and streamlining of code and is needed to understand how the OS does its thing. A computer language is simpily a tool, nothing else. Just as there are certain tools for certain jobs there are languages for certain jobs. I wouldn't think about writing a compiler in VB for example but I would write a Database intensive program in it without any qualms. I wouldn't think about writing a voice recoginization system in C++ but would choose ASM and C. I would hate to think about writing a GUI in anything but C++ but I could if I had to. Remember the old joke: To someone with just a hammer everything looks like a nail. Get more tools :) Richard
i know plenty of programmers who don't know a thing about assembly, or the ancient C runtimes, but they can write good C++ that does the job, on time. and given the deadlines we're often faced with, elegance and a deep understanding of what's going on is at best a luxury to play with when things slow down or at worst a hinderance to just getting the job done. yes, i could speed up that loop, but why bother? the customers can just buy a faster machine, for the money it costs to pay programmers to seriously optimize the app. personally, i love elegant code and could spend all day rewriting chunks of our apps to be quicker, smoother and frankly, prettier on-screen. and, yes i do know what's going on under the covers. but, that doesn't necessarily make me a better programmer in the eyes of my employers, who are only interested in the speedy delivery of the final product. so, i do what it takes to get the job done by day, and hand-craft my inner loops by night. and, to get back on topic, i think C and assembly are counterproductive, to someone who knows Perl and VB (very high level languages) and wants to learn another language. -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
-
"and if you take the C out of C++, you get Java or C#." I don't think so. In C++, you still have templates, MI, default args. I vote pro drink :beer:
More than that, in Java you can't choose if your args are passed by ref or by val.:(( In C# you can. C# = (5*Java + c++)/6
-
What is MFC ? I know that it stands for Microsoft Foundation Class but what does it do. BTW, can Java be compiled in to an exe ?
MFC stands for Microsoft Frustration Classes and OWL stands for Outdated Windows Library old joke, old Dr. Dobb's ad, but still true. ;) Furor fit laesa saepius patientia
-
Hi, i am planning to learn C or C++. Can someone tell me the difference between the two ? Which one is recommended for begginners ? Which one is more powerful ? Pros and Cons of each one. Which one is better ? Which one is harder ? etc. I don't know anything about C or C++ and would like to know more about it. I definetly want to learn them. I have had experience in Perl and Visual Basic before. Thanks. Hassan
Check out Stroustrup's FAQ http://www.research.att.com/~bs/bs\_faq.html#C-is-better