|
-
March 9th, 2012, 04:38 PM
#1
C+
Hello
I was wondering if anyone know where I can fin a good glossary for C+ language. For instance cin means ????I think count.
Thank you
-
March 9th, 2012, 06:20 PM
#2
Re: C+
There is no language "C+", but if you want a quick reference for C++, check out http://www.cplusplus.com/.
cin has nothing to do with counting.
-
March 10th, 2012, 07:24 AM
#3
Re: C+
Any book for C++ beginners can provide you such kind of glossary or visit the below link
http://msdn.microsoft.com/en-us/library/3bstk3k5.aspx
regards,
vatsa
www.objectiveprogramming.com
-
March 10th, 2012, 07:58 AM
#4
Re: C+
And, mainly for the sake of completeness, here's what you literally asked for: a glossary (from a really authoritative source ): http://www2.research.att.com/~bs/glossary.html
It does explain cin, but that explanation is just two words. The other two links posted are somewhat more instructive...
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
March 10th, 2012, 10:31 AM
#5
Re: C+
I agree that we should point the OP to a reference, however, I think that the question is of a slightly different nature - if the OP's native language is not English, and if the OP is just beginning C++, it might be hard for him/her to understand why things like cin or cout are named like that, or even that they don't represent C++ keywords. Basically, I think he/she asks what "cin" literally means, not just what it does? You know: why that specific name.
If you think about it, it can be quite confusing for a non-English speaking novice, especially if he/she wasn't introduced yet to streams, or classes and objects for that matter.
@OP: Take a look at this image:

As you can see, the standard C++ library contains, among other things, these classes that help you work with streams.
From the source page:
A stream is an abstraction that represents a device on which input and ouput operations are performed. A stream can basically be represented as a source or destination of characters of indefinite length.
Streams are generally associated to a physical source or destination of characters, like a disk file, the keyboard, or the console, so the characters gotten or written to/from our abstraction called stream are physically input/output to the physical device. For example, file streams are C++ objects to manipulate and interact with files; Once a file stream is used to open a file, any input or output operation performed on that stream is physically reflected in the file.
So basically, the person(s) who created these classes followed a naming convention, to designate what the classes do.
With that in mind, here's a quick glossary for you - this is what the names stand for:
- ios = input/output stream
- iostream = input/output stream
- istream = input stream
- ostream = output stream
- fstream = file stream
- ifstream = input file stream
- ofstream = output file stream
- cin = "c-in", or "c input" - the standard input stream
- cout = "c-out", or "c output" - the standard output stream
- cerr = "c error" - the standard error-output stream
- clog = "c-log" - the standard log-output stream
I hope you can see the pattern in the naming. Some things repeat in various forms because the implementations (that is, what they do, how they do it, and what they are used for) are different (some classes are used as base classes for the others, derived classes extend those base classes). In any case, to find out what exactly each of these is used for, you should consult a reference of some sort.
Note: cin, cout, cerr, and clog have a black background in the image because these aren't classes, but objects ready-made for you. To use some of the other classes, you need to create their objects yourself (just like you can create variables and assign values to them). You'll learn all about that soon enough.
-
March 11th, 2012, 04:45 AM
#6
Re: C+
 Originally Posted by Japp
For instance cin means ????I think count.
I'd say c refers to the C language and in to standard input.
C has the notion of standard input and by default it's the keyboard. But it's also possible to redirect standard input when a C program is started, for example to a file. The program will work as before oblivious to the fact that the input character stream isn't typed-in by someone but is read from a file instead. It's even possible to redirect standard input to another program. Then the program reading from standard input will get its input characters from the standard output of another program. One program is acting keyboard for another program. Pretty cool.
Now since C++ is an extension of C it also has a standard input and cin denotes that this is the C++ way of doing standard input ala C.
-
March 13th, 2012, 08:55 AM
#7
Re: C+
 Originally Posted by nuzzle
I'd say c refers to the C language and in to standard input..
Funny, I never thought about the meaning of the c in cin/cout/cerr/clog.
It was always clear for me that it means console. ( the standard in/output device )
Kurt
-
March 13th, 2012, 09:06 AM
#8
Re: C+
Besides his C++ glossary, Stroustrup also has a C++ Style and Technique FAQ which states for cout that 'the "c" stands for "character" because iostreams map values to and from byte (char) representations.'
This presumably also applies to cin.
-
March 16th, 2012, 02:48 PM
#9
Re: C+
TheGreatCThulhu, if the person's english is that bad, they won't unbderstand what you wrote. Any C++ book in their native language will explain it for them.
"Effective teaching is the essence of leadership..."
"There is no substitute for a carefully thought-out design."
If you have found this post to be useful, please Rate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|