• Welcome to Valhalla Legends Archive.
 

#include <iostream>

Started by ColT, November 27, 2004, 06:57 PM

Previous topic - Next topic

ColT

Hi, I am currently learning Visual C++.  I just wanted to know what  <iostream> mean's.
Also, I might ask some really noob question's, but please pardon me.
             

(Edit) also what do all the }, { mean when writing code in Visual C++?                                                                                                                                 

MyndFyre

<iostream> It is a collection of functions and objects that provide for input and output.  In learning C++, the most common reason to include <iostream> in console applications is the cin and cout objects:


cout << "Hello, world!";


Brackets denote blocks, which provide scope for variables.  They are used in loops and conditionals:


// This if statement only executes one statement after it, if the condition returns true.
if (TRUE)
  return;

// This one executes a block of statements
int i = 0;
if (TRUE)
{
  i++;
  i--;
}
// In this case, you can still access the i variable after the block exits.

if (TRUE)
{
  int i = 0;
  i++;
  i--;
}
// In this case, the i variable is only usable inside of the block.

Cheers.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

ColT