On Dec 24, 2007 12:52 PM, Robert Ryan <[EMAIL PROTECTED]> 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,
C only has pass by value. Whether that value is the 'value of the variable' or the 'value of the variable's address' (i.e. a pointer) makes no difference. The latter is sometimes called 'pass by reference,' and for most intents and purposes, it acts as if it is. > but C++ has only pass by reference. C++ has what C has, plus pass by reference. > In 'pass by value' the value does not change when passed from an actual > parameter to a formal parameter and > with pass by reference in C++ the value changes If what's being 'passed by value' is the value of the variable, then this is correct. If the address is passed, then what it points to can be changed. > 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. Imagine the user is to the left of your screen. << sends stuff to the user, >> retreives it from the user. > thanks -- PJH http://shabbleland.myminicity.com/
