Robert Ryan wrote: > thank you very much for the explanation of * and &. unfortunately, it > is going to take me some time to understand this pointer business. is > it true that C has both pass by value and pass by reference, but C++ > has only pass by reference. In 'pass by value' the value does not
A lot of people consider C++ as "a better C that does all C does plus some". While both languages are distinct, it is fairly easy to see how people come to such a conclusion since C++ can do roughly 99% of what C can do plus it has all the C++-specific stuff (classes, templates, etc.). A lot of the old functionality of C was "migrated" to C++ (not technically correct either). All the examples I gave will work under C++...but why someone would want to mess with pointers when C++ can handle the majority of that nonsense* behind the scenes is somewhat beyond me. * I fully understand how to use pointers and have typecast void *'s 6 levels deep with the best of 'em but the C++ way of doing things has grown on me. > change when passed from an actual parameter to a formal parameter and > with pass by reference in C++ the value changes I work mainly on C++, > but I use C because I think C is easier to understand. sometimes I > get confused with the >> and <<. The >> is for cin which gets printed > to the screen and << which is cout, the input thanks bob Keep in mind that you don't HAVE to use cin/cout with C++. I use printf() all the time because I'm used to it and don't care for the name choices for cin and cout nor choices made for the overloaded operators. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
