Discussion: cin src
Afficher un message
Vieux 17/10/2007, 14h08   #4
Stuart Redmann
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: cin src

America01@gmail.com wrote:
> Hello, I am new to C++ and I had a question I couldn't seem to find a
> answer to. I want to see the source of cin, I am running Linux and I
> went into /usr/include and didn't find anything retaining to cin. Is
> there even a source file for cin? I would assume so since it's a
> function...


If you want to use 'cin' as a programmer, you should not care much about it,
'cin' is just there. You should be aware that cin, being an istream-object, is
just an interface that you can use to retrieve data. What the actual source of
the data is, depends on how the executable/binary on your system had been
launched (for example the user may have 'piped in' the contents of a file). Thus
it is up to C++ run-time environment to provide you with the proper object
behind 'cin' (which would be either a ifstream or some other stream that is tied
to the console). This is all very platform dependent, and thus off-topic in this
newsgroup.

As a user of 'cin' you should write code that does not depend on which data
source for 'cin' is actually used.

Regards,
Stuart
  Réponse avec citation
 
Page generated in 0,06833 seconds with 9 queries