P.L.E.A.S.E. H.E.L.P. M.E.

i am doing a simple stopwatch program and i need to know how to start/stop it. i want to hit enter to start/stop it but i dont know how. P.L.E.A.S.E. H.E.L.P. M.E.


PS. 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#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()
{
    double time = 0.0;
    cout << "hit enter to start timer.";
    char choice;
    cin >> choice;
    switch (choice)
    {
           
    )              
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    cout << "                               " << time << "" ;
    _sleep(100);
    system("CLS");
    time = time + 0.1;
    
    
    system("PAUSE");
}
How adverse are you to using SFML? You could learn all you need for this program and get it written in an afternoon.

If you're not interested in that for a solution this can be done with the Win32 API as well.
*pukes* You know cainen172, your posts are getting me sick, and please stop posting with subject lines where each word is separated by a '.'

T.H.A.N.K.S
wats makin u mad bout them?
just tell me wat it is and ill try to stop. im not trying to get on your nerves
closed account (z05DSL3A)
cainen172,

May I ask how you are learning C++?
mostly through trial and error, other peoples forums, my forums, and a few books. o and also youtube has taught me a couple of things
cainen172, have you tried stepping through the tutorial on this site? http://www.cplusplus.com/doc/tutorial/
ya but i dont understand the way they word some of the things on there.
it getting me sick
Last edited on

o and also youtube has taught me a couple of things


Youtube is a HORRIBLE place to learn programming.
Also, loops would save you, in this case, 135 lines of typing (or copy&paste).

I'd suggest reading the tutorial Return 0 posted.
Or may be pick up a good book, like C++ Primer by Lippman
or
Thinking in C++ by Bruce Eckel
closed account (z05DSL3A)
cainen172,

I would suggest, as anonymouscoder6, you get C++ Primer by Lippman and just work from that. The single source will give you what you need to know, when you need to know it, and in a consistent manner.
Topic archived. No new replies allowed.