Author Topic: terminology help? WTF does this mean?  (Read 1938 times)

0 Members and 1 Guest are viewing this topic.

Offline Unah_Xakabah

  • /dev/null
  • *
  • Posts: 5
  • Cookies: 0
    • View Profile
terminology help? WTF does this mean?
« on: July 18, 2011, 04:53:03 am »
im a noob,and i just want help to know exactly what these things tell the computer


int
endl;
cout
cin
std;
>> 
<<
<iostream>
DoPrint()


i have no idea how noobie this is i am such a noob. just dont give me shit for it,try and tell me as bes toyu can what they tell the COMPUTER to do.

Offline shroudedaether

  • NULL
  • Posts: 4
  • Cookies: 1
    • View Profile
Re: terminology help? WTF does this mean?
« Reply #1 on: July 18, 2011, 06:34:53 am »
int is a datatype for a variable. In this case, integer.

endl inserts a newline character(\n), and in buffered streams, flushes the buffer. The ; at the end ends the line.

cout is an object of the ostream class which prints text/data out to the terminal/command prompt.

cin takes input from the user via the terminal/command prompt.

std refers to the standard library. Usually, things like cout would have this prefaced (std::cout), but if using namespace std; is included, you can leave out the std:: and just use cout to echo.

>> is the extraction operator. It performs an input operation on a stream.

<< is an insertion operator. Does the opposite of >>. I'm sure you can figure it out.

<iostream> is used after an #include to include the file "iostream" from the compiler's include directory (<> specify the compiler include dir.) Iostream provides input and output functionality using streams.

DoPrint() is used to call the function DoPrint, which I assume is somewhere in your code.


As well, I'm going to take this time to link you to a few websites that may help you learn this, and a few books as well.

Websites:
learncpp.com
Not overly familiar with the website myself, but saw a good review on it and skimmed over it. Seems decent.

http://cplusplus.com/
Not a bad website. Has a decent reference. A bitch to navigate IMO, however.

(Note on the websites: A lot of these websites don't exactly teach the best practices. While excellent for learning at the beginning, they won't teach you everything, and take everything you read with a grain of salt.)

Books:
C++ Primer
Great for beginners. I'd honestly recommend it.
http://www.demonoid.me/files/details/2231948/63090872/
http://www.amazon.com/Primer-Plus-4th-Stephen-Prata/dp/0672322234
« Last Edit: July 18, 2011, 06:44:57 am by shroudedaether »

Offline Kreek

  • Peasant
  • *
  • Posts: 134
  • Cookies: 2
    • View Profile
Re: terminology help? WTF does this mean?
« Reply #2 on: July 18, 2011, 10:30:19 am »
im a noob,and i just want help to know exactly what these things tell the computer


int
endl;
cout
cin
std;
>> 
<<
<iostream>
DoPrint()


i have no idea how noobie this is i am such a noob. just dont give me shit for it,try and tell me as bes toyu can what they tell the COMPUTER to do.

Are u serious?  :o

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: terminology help? WTF does this mean?
« Reply #3 on: July 18, 2011, 12:15:34 pm »
im a noob,and i just want help to know exactly what these things tell the computer


int
endl;
cout
cin
std;
>> 
<<
<iostream>
DoPrint()


i have no idea how noobie this is i am such a noob. ijust dont give me shit for it,try and tell me as bes toyu can what they tell the COMPUTER to do.

this wont telll the computer anything, but the c/c++ compiler.
Please considering google some tutorials on it before askin it here :)
goodluck
~Factionwars