What is wrong in this code C++ ?

Hello :) .
I wannt to know what is wrong in this code,because i get this error:
fatal error C1083: Cannot open precompiled header file: '/Debug/ass.pch': No such file or directory. Error executing cl.exe

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
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    
    cout<<"Numele Hack-ului vine aici"<<endl;
    cout<<"Hack by NUME! Thanks for download!"<<endl;
    cout<<"\n";
    Sleep(500);
    
    cout<<"The hack is starting";
    Sleep(700);
    cout<<"\rThe hack is starting.";
    Sleep(700);
    cout<<"\rThe hack is starting..";
    Sleep(700);
    cout<<"\rThe hack is starting..."<<endl;
    
    Sleep(1000);
    cout<<"Checking for the latest updates";
    Sleep(600);
    cout<<"\rChecking for the latest updates.";
    Sleep(600);
    cout<<"\rChecking for the latest updates..";
    Sleep(600);
    cout<<"\rChecking for the latest updates..."<<endl;
    Sleep(1700);
    cout<<"An available update was found!"<<endl;
    Sleep(600);
    
    
    
         
     cout<<endl;
     
     
     for (int i = 0; i<=4; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(900);
     }
     
     for (int i = 5; i<=24; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(300);
     }
     
     for (int i = 25; i<=49; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(100);
     }
     
    for (int i = 50; i<=71; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(350);
     }
    
    for (int i = 72; i<=83; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(200);
     }
     
    for (int i = 84; i<=96; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(450);
     }
     
    for (int i = 97; i<=100; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(1600);
     }
    
    cout<<endl;
    cout<<"\n";
    Sleep(600);
    cout<<"You have the latest version!"<<endl;
    Sleep(1500);
    
    
    cout<<"The hack will start in a few seconds";
    Sleep(700);
    cout<<"\rThe hack will start in a few seconds.";
    Sleep(700);
    cout<<"\rThe hack will start in a few seconds..";
    Sleep(700);
    cout<<"\rThe hack will start in a few seconds..."<<endl;
    
    cout<<endl;
    cout<<"\n";
    
    Sleep(2000);
    cout<<"ERROR: Your operating system is not compatible with this hack! (code error:#9H7ABLO)"<<endl;  
    
    cout<<"\n";
    Sleep(2000);
    cout<<"\n";
    
    system("PAUSE");
    return EXIT_SUCCESS;
}
Try creating an empty project, instead of using a template project.

(Yes, you will need to re-copy-paste the code)
yes, but now i receive another error:
'i' : redefinition; multiple initialization
........(this is the way of file) : see declaration of 'i'

I don`t know how to declare 'i' , in that code .
It seems that you are using an old compiler that does not consider variables decalred in the for statement as having only the for statement block scope.

You can define variable i only once in the beginning of the program. For example

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
     int i;

     for ( i = 0; i<=4; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(900);
     }
     
     for ( i = 5; i<=24; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(300);
     }
     
     for ( i = 25; i<=49; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(100);
     }
     
    for ( i = 50; i<=71; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(350);
     }
    
    for ( i = 72; i<=83; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(200);
     }
     
    for ( i = 84; i<=96; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(450);
     }
     
    for ( i = 97; i<=100; i++) {
          cout<<"\rUpdating: "<<i<<"%"<<flush;
          Sleep(1600);
     }

Last edited on
^ That.

To simplify your code some more, you can also:

1
2
3
4
5
6
7
8
9
10
11
int i = 0;
for( ; i <= 4; i++)
{
    cout<<"\rUpdating: "<<i<<"%"<<flush;
    Sleep(900);
}
for( ; i <= 24; i++)
{
    cout<<"\rUpdating: "<<i<<"%"<<flush;
    Sleep(300);
}
YES, Is working.

I add
int i;And it work
Topic archived. No new replies allowed.