So, I wondered what would be the easiest way to check user input (stdin). I came to the conclusion, ideally this would scan user input and print the results.
Although now I'm a little confused about how to do this. Here is what I thought:
#include <stdio.h>
int main(){
char input[30];
printf("Please enter text\n");
scanf("%s", &input);
...
So, here is the part that I canβt wrap my head on. So, what I would like to do, runs through the whole word (input), character by character.
Basically, if a string contains only numbers (0-9), I would like the input to be identified as a number. Otherwise, define it as a string.
( , ), strcmp(), , string.h , .