in the FIRST tut. it says to put this
y when i complie it and run it the window closes INSTANTLY?Code:#include <iostream.h> int main() { cout<<"HEY, you, I'm alive! Oh, and Hello World!"; return 0; }
im using DEV-C++
in the FIRST tut. it says to put this
y when i complie it and run it the window closes INSTANTLY?Code:#include <iostream.h> int main() { cout<<"HEY, you, I'm alive! Oh, and Hello World!"; return 0; }
im using DEV-C++
Search The Board You F-ing F-er!
FAQ FAQ FAQ
Do not make direct eye contact with me.
jeez thx anyways
Hey ringo I'll help you
I dont think people on here half the time argue about this but the easiest way to get started is to make sure you put after
#include (iostream)
is
using namespace std;
and even if people dont think its a good idea to use, as someone new, it wont matter in the slightest.
Enjoy programming dont let anyone put you off, and reach as far as you want to go, that's what I am doing and I will get there!
k thx i got the idea now
My Pleasure!
I'm gonna go kill myself now.
Do not make direct eye contact with me.
what is the point of LOOPING?
what can it be used for?
looping can b used to count, thats the simples example lol if u want to add numbers from1 to 10 u use a loop to do it
When no one helps you out. Call google();
i need help again......how would i make this loop 2 times?
thx for helping peoples
i tryed changing the while(x!=0); TO while(x!=2);Code:#include <iostream.h> int main() { int x; x=0; do { cout<<"Hello world!"; }while(x!=0); return 0; }
but it repeats endlessly
Last edited by rigo305; 04-23-2004 at 06:27 PM.
That's a for loop
I didn't test it... may be a problem or two...Code:#include <iostream> int main() { int x; for(x=0; x<2; x++) //set x to 0, while x is less than 2, increase x by one each time { std::cout << "Hello world!" << std::endl; getch(); } return 0; }
oo great thx ic know
what does std:: mean?
EDIT: is it needed?
Last edited by rigo305; 04-23-2004 at 06:39 PM.
That means that whatever member on the right of it is part of the std namespace.
You can think of namespaces as a way to organize your code. Functions, definitions and data that share a common task can be put into a namespace so that others can use the same names you used (common names like create, destroy, etc) but be in a different namespace.
You can place std:: in front of all the standard library members but you don't have to if you include them all in at once, or one at the time:
The std:: is needed unless you do one of the above.Code:using namespace std; // all at once // one at the time using std::cout; using std::endl;
o ic
so i can write
is
using namespace std; //at the top right?