Browse Source

refactoring: Rename global variable and define

remotes/origin/Input_Handling
Sophia Weber 11 months ago
parent
commit
0cd447599e
  1. 8
      src/main.c

8
src/main.c

@ -3,12 +3,12 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define STRINGL 200
#define STRING_LENGTH 200
char a[STRINGL] = {0};
char inputBuffer[STRING_LENGTH] = {0};
void main() {
printf("Geben Sie eine Rechenoperation ein (Bsp.: 1+1):\n");
fgets(a, STRINGL, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace
processInput(a, strlen(a));
fgets(inputBuffer, STRING_LENGTH, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace
processInput(inputBuffer, strlen(inputBuffer));
}
Loading…
Cancel
Save