Hi,
I'm writing a program that will do what the UNIX cut command does. I've written the code to read in the ranges, and to open a file for reading.
I have two seperate char arrays which hold the ranges for -c and -f.
For example, cranges holds
Code:
{'1', '-', '3', ',', '4', ',', '5', '-'};
Each range is delimited by a comma.
I have written a function which takes a range and returns an integer depending on what type it is:
N
N-M
N-
-N
I'm wondering how to best take each range and pass it into my get_range function. I was trying to tokenize the array, but that just crashes my program.