|
|
@ -14,4 +14,17 @@ int main() { |
|
|
|
} |
|
|
|
printf("\nPlease enter the first and the second number separated by a space...\n"); |
|
|
|
|
|
|
|
while(fgets(buffer, 100, stdin)) { |
|
|
|
buffer[strcspn(buffer, "\n")] = '\0'; |
|
|
|
if (strlen(buffer) > 0) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int* result = evaluateInput(buffer, input); |
|
|
|
if(result == NULL) { |
|
|
|
printf("\nInvalid formatting. Two numbers need to be separated by a space\n"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
printf("\nResult: %d", *result); |
|
|
|
} |