diff --git a/src/main.c b/src/main.c index 4f4b2b5..befd311 100644 --- a/src/main.c +++ b/src/main.c @@ -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); } \ No newline at end of file