stopwatch errors

ok so this is my code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
int main()
{
    string s = s;
    system("PAUSE");
    double time = 0.0; 
    do
    {
    system("TITLE Stop Watch!!");
    system("COLOR 29");
    cout << "                               " << time << "\n\n\n" ;
    cout << "to pause hit p" ;
    cin >> s;
    if ( s == "s")
    {
         system("PAUSE");
         }
    _sleep(45);
    system("CLS");
    time = time + 0.1;
    }
    while (time <= 1000);
    if (time == 1000);
    {
             cout << "whatever you are timing takes a really long time.........." ;
             system("PAUSE");
             return 0;
             }
    
    
    system("PAUSE");
}

the ide comes up with no errors but when the program window comes up it says
stopwatch.exe has stopped working windows is searching for a sollution
Have you tried debugging it to see when it crashes? Or does it crash before it even starts?
no i havent. but when try it just tells me that i dont have debugging info. and then it asks if i want to enable debugging and rebuild my program???????? what do i do?????
to rebuild it can i just copy my code and paste it back???
Cainen172 - Never use system("pause") if you are serious about programming. Its non standard and a bad programming habbit.
Check out this link for the reason behind it and alternatives for this:
http://www.gidnetwork.com/b-61.html
And are you still looking for help on this topic or done with this?
thanx alot anonymouscoder6 but it still comes up with that same error. (the error is like the kind you get when you are on the internet and it stops responding)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <windows.h>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::numeric_limits;
using std::streamsize;
int main()
{
    string s = s;
    cin.get();
    double time = 0.0; 
    do
    {
    system("TITLE Stop Watch!!");
    system("COLOR 29");
    cout << "                               " << time << "\n\n\n" ;
    cout << "to pause hit p" ;
    cin >> s;
    if ( s == "s")
    {
         cin.get();
         }
    _sleep(45);
    system("CLS");
    time = time + 0.1;
    }
    while (time <= 1000);
    if (time == 1000);
    {
             cout << "whatever you are timing takes a really long time.........." ;
             cin.get();
             return 0;
             }
    
    
    ;
}
still having trouble... that was a link to the errors. i have tried making the code again and it wont work still.
Last edited on
Topic archived. No new replies allowed.