So I'm a newcomer to C and I've just learned about string after array. Now I'm trying to write a program that convert a string which consists of only integer numbers into an integer array.
For example let's say I have this string og[] and use fgets to get the input: og = 123456
Then I want to convert this '012345678' string into an array, let's say mod[] which be like:
mod[0] = 1;
mod[1] = 2;
mod[2] = 3;
mod[3] = 4;
mod[4] = 5;
mod[5] = 6;
Is there any method to achieve this quickly with a function? If no, how could I write a function to convert this?
Thank you in advance.