I have to input a string and to get from it the course Id and the course name.
my code for this is:
char word[200];
int id=0;
char *ptrWord;
scanf("%[^\n]", word);
printf("%s\n", word);
id = strtol(word, &ptrWord, 10);
these are examples of a valid input.
89110 Computer Science 101
89210 Advanced Programming 1
89111 OOP 101
My question is, how to get rid of the spaces after the id ? for example, the course name of the last input is OOP 101, but using this method i get the whitespaces before the name, and i don't want them.