Build Error?

I am using to try and make a calculator.
When I try to build the code it gives me this error.

||=== Build: Debug in Calculator Final (compiler: GNU GCC Compiler) ===|
ld.exe||cannot open output file bin\Debug\Calculator Final.exe Permission denied|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
||=== Run: Debug in Calculator Final (compiler: GNU GCC Compiler) ===|

Here is the 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
  #include <iostream>

using namespace std;

int main()
{
    int a;
    int b;
    int sum;
    int start;
    char sign;
    int remainder;

    cout <<"Press 1 to start the calculator\n";
    cin >> start;

    if(start == 1)
    {
        cout <<"Starting Calculator...\n";
    }
    else
    {
        return 0;
    }
    cout <<"Enter the first number\n";
    cin >> a;

    cout <<"Enter the sign + , - , * , or /\n";
    cin >> sign;

    cout <<"Enter another number.\n";
    cin >> b;

    if(sign == '+')
    {
        sum = a + b;
        cout <<"The answer of " << a << sign << b << " is: " << sum << endl;
    }
    else if(sign == '-')
    {
        sum = a - b;
        cout <<"The answer of " << a << sign << b << " is: " << sum << endl;
    }
    else if(sign == '*')
    {
        sum = a * b;
        cout <<"The answer of " << a << sign << b << " is: " << sum << endl;
    }
    else if(sign == '/')
    {
        sum = a / b;
        remainder = a % b;
        cout <<"The answer of " << a << sign << b << " is: " << sum << " Remainder: " << remainder << endl;
     }
    else
    {
        cout<<"You entered an invalid sign."<<endl;
    }
    return 0;
}


Thanks.
"Permission denied" is not due to the code.

I would avoid whitespace characters in filenames.
Thanks.
Topic archived. No new replies allowed.