In C Programming, how do I store user input in a variable so that I can get a substring from it? When typing in "hello Point" in the console I get an error: The substring is NULL. This means my word variable is empty? What exactly did I do wrong and why?
#include <stdio.h>
#include <string.h>
int main()
{
char word[100];
printf ("Enter a word: ");
scanf ("%s", word);
const char needle[] = "Point";
char *ret;
ret = strstr(word, needle);
printf("The substring is: %s\n", ret);
return(0);
}