Hi all~
I am learning C++ step by step with my BCB, and I try to write some simple code under console mode, but the result splashed no more than half a second when running my code. how could I see it clearly ? :confused:
Printable View
Hi all~
I am learning C++ step by step with my BCB, and I try to write some simple code under console mode, but the result splashed no more than half a second when running my code. how could I see it clearly ? :confused:
Hey I know it is not the most sophisticated way of doing it, but it does the job...
hope that helps for now, but there are many other ways of doing it.Code:
int main(void)
{
// you code here
char c; cin>>c; //consoles waits for a char input before exiting.
return 0;
}
put getchar() above return 0 and that will work.
So that you don't have to include another header or create a new variable, just use get:
-PreludeCode:<snip the whole program>
cin.get()
return 0;
}
yah that too...
:D
Just read a book :) That's what I did when I first started learning C. I had no programming experience prior to that. Now I code in C++ well ;)
Yah right...
Like us poor ppl are gonna pay 60$ for something they can find out here.
:p
I did not buy any book. Just borrowed one :) I had no one to teach me too.
I have 2 wonderful books, and it is a pity that I could not figure it out right now. thanx, guy~ ;)Quote:
Originally posted by billholm
Just read a book :) That's what I did when I first started learning C. I had no programming experience prior to that. Now I code in C++ well ;)
one of my book is Thinking in C++, I was sometimes confused when reading it, would it be suitable for beginners just like me ? :rolleyes:
Yes that's a good book, but some parts of it assume that you have prior knowledge to C.
Try C++ Pimer (forgot the author) or The C++ Programming Language by Bjarne Stroustrup or any book that does not assume prior programming experience. :)
:cool:
Black that is a nice Avatar.
Right! :D :cool:
yah~ I heard those 2 books before. I remember one of them have more than 1000 pages, right ? and the total would be 1800 pages or so, God~ :eek:Quote:
Originally posted by billholm
Yes that's a good book, but some parts of it assume that you have prior knowledge to C.
Try C++ Pimer (forgot the author) or The C++ Programming Language by Bjarne Stroustrup or any book that does not assume prior programming experience. :)
:cool:
anyone could lend me time then ? ;)
No no you don't have to read ALL of the pages :)
Just use the books as your reference. Consult it if you have a few programming questions in mind then apply them to your codes :)
That's what I did. :D
if you don't want the user to have to press a key, and would rather have a delay, just include <windows.h> and use the Sleep(..) function:
Code:#include <iostream>
#include <windows.h>
using namespace std;
int main(int argc, char *argv[])
{
cout << "Hello World";
Sleep(1000); // Sleep(Number Of Milliseconds);
cout << "\n1 Second Delay!";
Sleep(1000);
return 0;
}
thanx~ ;)Quote:
Originally posted by Vicious
Black that is a nice Avatar.