User forums > General (but related to Code::Blocks)
2 basic C::B questions from a newbie
temujin:
Dear Forum,
I´m a newbie just starting with C::B to learn C++, wondering about 2 things when compiling and running the standard console program ("Hello World").
#include <iostream>
int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}
1. Where is the code that says "press ENTER to continue" in the output, and how can I disable it? (...yes, I tried to search previous posts).
2. Why do I have to include <iostream> and not <iostream.h>? I thought this was only possible when explicitly using the namespace in which the library residesin.
best regards
t.
thomas:
1. is done by Code::Blocks, it has nothing to do with your program. If you run your program elsewhere, it will not appear.
2. This is the C++ standard for.... 5? 6? years now. There is no reason other than "this is how it is".
lubos:
you can disable it in project->properties->build target->pause when execution ends :)
temujin:
--- Quote from: thomas on August 15, 2007, 06:16:02 pm ---2. This is the C++ standard for.... 5? 6? years now. There is no reason other than "this is how it is".
--- End quote ---
Thanks...How do I know which libraries need the .h extension and wich that don´t? E.g. including windows I need <windows.h>
regards
t.
lubos:
--- Quote from: temujin on August 15, 2007, 06:50:44 pm ---
--- Quote from: thomas on August 15, 2007, 06:16:02 pm ---2. This is the C++ standard for.... 5? 6? years now. There is no reason other than "this is how it is".
--- End quote ---
Thanks...How do I know which libraries need the .h extension and wich that don´t? E.g. including windows I need <windows.h>
regards
t.
--- End quote ---
c++ standard headers are without .h
Navigation
[0] Message Index
[#] Next page
Go to full version