Originally Posted by dreamboy
Good Morning to every body! I am a hobby programmer and join in this forum today. I have code a program of stop watch in c++ and compiled and run well.but I want to see the Win32 application istead of console appln. Please anybody can help how to code for win32? The source code of console appln for stop watch as given below.
// example2.cpp : Defines the entry point for the console application.
using namespace std;
int _tmain(int argc, _TCHAR* argv)
cout << endl << "Hello ! This is a Stopwatch application programmed by T.Kannan" << endl;
cout << endl << " Press Q to Quit else any Charactor followed by enter Key to start STOP WATCH" << endl;
cin >> stop;
while(stop != 'Q')
for(ms=1; ms<=100; ms++)
cout << " Minutes : Seconds : Milliseconds";
cout << endl << endl << " " << m << " : " << s << " : " << ms << endl;
cout << endl;
cout << endl << "Hello ! 1 Minute duration gone programmed by T.Kannan" << endl << endl;
cout << "M: " << m;
cout << " S: " << s;
cout << " MS: " << ms << endl << endl;
cout << " Press Q to Quit else any Charactor followed by enter Key " << endl;
cin >> stop;
Other then your name what you actually wrote in this code?
Your code remindes me 286, 386 era when I started learning C language.
It's printf() for screen output and system() for calling DOS commands or any executable eg .exe,. com, .bat etc.
Anyway code is not good.
Run and check how many minutes it takes to show 1 minutes on different PCs with processors of different speed.
It is not stop watch. It runs for so called 1 minute under all cercumtences.
There was no need of clearing screen in inner loop that also using system("CLS"). Use gotoxy() instead and over wright new time over old time..
Anyway from where ever you start keep trying.
It is good to search and read code on net.
Not only try them also try to modify them. This way you will learn.