Why doesn't this C-program compile and what does the err messages mean:
#include <stdio.h>
int main() {
char op = ' ';
char cont = ' ';
int tal1 = 0;
int tal2 = 0;
int result;
int ok = 1;
printf("Welcome\n");
do {
printf("Which one (+ - * /)? ");
scanf("%c", &op); fflush(stdin);
printf("Number?: ");
scanf("%d", &tal1); fflush(stdin);
printf("Number: ");
scanf("%d", &tal2); fflush(stdin);
ok=1;
switch(op){
case '+':
result=tal1+tal2;
break;
case '-':
result=tal1-tal2;
break;
case '*':
result=tal1*tal2;
break;
case '/':
result=tal1/tal2;
break;
default:
printf("Wrong\n");
ok=0;
break;
}
if(ok)
printf("Answer: %d\n", result);
printf("Continue? (j/n)"); fflush(stdin);
}while (cont == 'j');
printf("Thanks!\n");
return 0;
}
Err mess: Error 4 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib Error 5 fatal error LNK1120: 1 unresolved externals