77. Parse Comma-Separated Integers into an Array

You are given a comma-separated string of integers (e.g., "10,20,30"). Each number is in the range 0–255.

Your task is to parse the string and extract all numbers into an array of integers.

  • Use only basic string logic (do not use strtok() or standard tokenizing functions)
  • Stop at the null terminator ('\0')
  • Store results into an uint8_t[] array and print them
     

Example-1

Input: "10,20,30"
Output: 10 20 30

 

Example-2

Input: "5"
Output: 5

 

Example-3

Input: "1,2,3,4,5"
Output: 1 2 3 4 5


 

Loading...

Input

10,20,30

Expected Output

10 20 30