Turn str input into different array elements

Welp, im new to arduino and without knowing anything i have been told to write some code in order to create an array out of a bunch of numbers separated with spaces. The user would write "9 16 7 4" (for example) and the array should be ["9","16","7","4"]. I have been searching info for a long time and still cannot find anything that helps me.

Where would the user write that?

The strtok() function does that. strtok() and strtok_r() functions in C with examples - GeeksforGeeks

In the serial line. I dont understand almost anything about arduino, and the programming tool i habe been told to use is the tinkercad arduino coding section, so i think the input comes from Serial

Thanks! After that ill need to make basic operations with those elements of the array, so ill se how it comes out

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.