Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10018

Re: ifstream ofstream ?

From Nobody <nobody@nowhere.com>
Subject Re: ifstream ofstream ?
Date 2011-09-10 10:23 +0100
Message-Id <pan.2011.09.10.09.23.08.169000@nowhere.com>
Newsgroups comp.lang.c++
References (4 earlier) <op.v1jlvvxx2juju3@ajwin7> <360b4ee2-dcc1-4667-867f-0865836e5ada@l4g2000vbv.googlegroups.com> <op.v1jovhwc2juju3@ajwin7> <ba101f66-eb32-4fdb-b7cd-b566d3c61fda@d18g2000yqm.googlegroups.com> <op.v1jqynep2juju3@ajwin7>
Organization Zen Internet

Show all headers | View raw


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.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

ifstream ofstream ? Asger-P <junk@asger-p.dk> - 2011-09-09 12:16 +0200
  Re: ifstream ofstream ? Goran <goran.pusic@gmail.com> - 2011-09-09 03:56 -0700
    Re: ifstream ofstream ? Asger-P <junk@asger-p.dk> - 2011-09-09 13:18 +0200
      Re: ifstream ofstream ? Goran <goran.pusic@gmail.com> - 2011-09-09 06:00 -0700
        Re: ifstream ofstream ? Asger-P <junk@asger-p.dk> - 2011-09-09 15:17 +0200
          Re: ifstream ofstream ? Goran <goran.pusic@gmail.com> - 2011-09-09 06:55 -0700
            Re: ifstream ofstream ? Asger-P <junk@asger-p.dk> - 2011-09-09 16:22 +0200
              Re: ifstream ofstream ? Goran <goran.pusic@gmail.com> - 2011-09-09 07:39 -0700
                Re: ifstream ofstream ? Stuart Redmann <DerTopper@web.de> - 2011-09-09 08:05 -0700
                Re: ifstream ofstream ? Goran <goran.pusic@gmail.com> - 2011-09-09 08:18 -0700
                Re: ifstream ofstream ? Asger-P <junk@asger-p.dk> - 2011-09-09 17:07 +0200
                Re: ifstream ofstream ? Nobody <nobody@nowhere.com> - 2011-09-10 10:23 +0100

csiph-web