On Fri, 09 Sep 2011 17:07:25 +0200, Asger-P wrote:
> In my head "ifile" is the name that refer to the instance
> of the ifstream class, so it kind of an reference, of course
> I know it is not the "reference kind" reference, You see my
> problem.
In C and C++, you have primitive types (basically numbers; integer and
floating-point types), aggregates (structures, unions and, in C++,
classes), arrays, pointers and (in C++) references (which are basically
pointers under the hood).
In Java, you have primitive types and pointers (references) to class
types. You can't have a pointer to a primitive type, nor can you have an
instance of a class type other than via a pointer/reference.
Hence, class types tend to be referred to as reference types. Assignment
copies the reference, not the object to which it refers; for the latter,
you need to use the .clone() method.
Neither C nor C++ have this restriction. Pointers/references aren't
required for aggregate types, nor are they restricted to them.