You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
845 B

#include "helloWorld.h"
#include "inputHandling.h"
#include "outputHandling.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define STRING_LENGTH 200
char inputBuffer[STRING_LENGTH] = {0};
void main() {
calc_op *result = NULL;
printf("Geben Sie eine Rechenoperation ein (Bsp.: 1+1):\n");
fgets(inputBuffer, STRING_LENGTH, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace
processInput(inputBuffer, strlen(inputBuffer));
do {
result = getNextCalc();
if (result == NULL) {
break;
}
if (result->functionsType==opResult) {
result->result = result->inputNumbers[0];
showResult(result);
break;
}
/* Calculation*/
result->result = 65478;
} while (1);
result = getNextCalc();
}