fgets giving me null
#include <stdio.h> #include <stdlib.h> int main () { int firstDigit; char *firstNumber = 0; char operator; int secondDigit; char *secondNumber = 0; printf("digit "); scanf("%d *[^\n]", &firstDigit); fgets(firstNumber, firstDigit, stdin); printf("%s \n", firstNumber); } The code here gives me null as firstNumber while it clearly should just be a string. here is the results of… Read More fgets giving me null