Hi Guys
This has been going on for a while but now I have finally decided to do something about it.
A few weeks ago I compiled a small C program from a book I was reading.
It compiled fine but I wanted to make a slight change to the code and instead of compiling the new code and calling it a different name I tried to delete the original exe (calculator.exe) so I could simply make a new one. But when I try to delete/copy or move the exe "Cannot delete calculator: it is being used by another person or program" I checked my running processes to see if for some strange reason the program was running in the background but nothing and the exe has been sitting on my desktop ever since and its annoying.
Does anyone know what I can do to remove this annoying exe please and does anyone know why this has happened.
Many thanks
HLA91
P.S here is the code
#include <stdio.h>
char line[100];/* Line of text from input*/
int result; /* This shpws the current result of calculation*/
char operator;/*Operator teh user specified*/
int value;/* Value specified after the operator*/
char enter;
int main ()
{
printf("H Calculator, for help/license press h, to quit press q\n");
printf("\n");
result = 0;
/* loop forever or until break reached*/
while (1) {
printf("\n");
printf("Enter calculation: \n");
printf("\n");
printf("Result: %d\n", result);
printf(" \n ");
fgets(line, sizeof(line), stdin);
sscanf(line, "%c %d", &operator, &value);
if((operator == 'q') || (operator == 'Q'))
break;
switch (operator) {
case '+':
result += value;
break;
case '-':
result -= value;
break;
case '*':
result *= value;
break;
case 'h':
printf("\tH Calculator\n");
printf("V 1.1\n");
printf("Written by Harry Angell, to use calc simply\n");
printf("Enter the operator followed by the number,eg: +5\n");
printf("\n");
printf("Press return");
fgets(line, sizeof(line), stdin);
sscanf(line, "%c" , &enter);
printf("\n");
printf("\n");
break;
case '/':
if (value == 0) {
printf("Error: Divide by zero\n");
printf(" operation ignored\n");
} else
result /= value;
break;
default:
printf("Unknown operator %c\n", operator);
break;
}
}
return (0);
}