Simple question (c++)

Started by
13 comments, last by swiftcoder 15 years, 1 month ago
Quote:Original post by Joshuad
Quote:Original post by Telastyn
Based on what you've learned, it's probably a good assumption. [edit: and certainly a good enough basis to go on for a while]

As for being 'correct'...


Ok...what is 'correct' then? My purpose in asking questions is to go from my educated assumptions to having a clean and proper understanding. Please enlighten me.


I'm not sure I can provide clean and proper understanding for Sneftel's original quote:
Quote:
learn exactly how the << operator is implemented?


Since it can be interpreted a few ways.

Most basically though, the << and >> operators are the C bitshift operators. C++ allows operator overloading. Simply put, it allows programmers to redefine the behavior of operators like the bitshift operators for classes (like the stream classes that define cout/cin) for which the operation is meaningless.

There's then a lot of minutiae regarding how C++ deals with binary operators, how overloading is done, the semantics behind the chaining trick to make cout << "foo" << a << b; work... But if you've not covered the arrow (->), then that's perhaps stuff left until later.
Advertisement
Well, I haven't learned very much in terms of pointers, which is probably why -> wasn't covered. I have a bad habit of starting books, getting to points where it no longer makes sense, and then jumping to another book (still keeping the beginners setting) hoping that it will cover the same concept in a cleaner, more organized way in hopes that I will understand it. Therefor, it is taking me longer than I had hoped, but I feel that I am getting a better understanding of the language itself. I've only been learning C++ for a little under 2 weeks if that makes you have a larger understanding. I'm not sure if my progress is good, or if it is incredibly horrible, heh.
Debug->"Run without Debugging". If you don't have this, you should upgrade your IDE to VS Express 2008. :-)
Quote:Original post by smitty1276
Debug->"Run without Debugging". If you don't have this, you should upgrade your IDE to VS Express 2008. :-)

Yeah this is the method I talked my college C++ professor into using so I wouldn't have to put system("PAUSE"); or some other kludge in all my C++ programs for that class [lol]

[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by daviangel
Yeah this is the method I talked my college C++ professor into using so I wouldn't have to put system("PAUSE"); or some other kludge in all my C++ programs for that class [lol]
Thank your lucky stars they use anything as modern as Visual Studio - half of mine still think ASNI C is pretty neat (my apologies for the thoroughly transparent Douglas Adams reference).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement