New course! Every coder should learn Generative AI!
Try a free lesson+ 2
You can use strtok() to find the delimiter character, i.e. " ", and atoi() to do the actual conversion, and repeat this procedure until the end of the string has been reached (no more delimiter tokens).
strtok:
https://en.cppreference.com/w/c/string/byte/strtok
atoi:
https://en.cppreference.com/w/c/string/byte/atoi