Valhalla Legends Forums Archive | C/C++ Programming | #include <iostream>

AuthorMessageTime
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++?                                                                                                                                 
November 28, 2004, 12:57 AM
Myndfyr
<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:

[code]
cout << "Hello, world!";
[/code]

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

[code]
// 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.
[/code]
Cheers.
November 28, 2004, 9:01 AM
ColT
Thank you, MyndFyre.
November 28, 2004, 4:23 PM

Search