In a program i'm writing i'm supposed to read user input on one line and the user will have a max of 6 things on the line. I've been trying to figure out how to read in this unknown number of things. Ideally I want all of these stored in an array. I tried using cin and using an array like this: cin >>array>>array>>array>>array>>array>>array;
This however will not allow them to skip any of the array. I have the rest of the program written but this is the last part I need.
Examples of user usage:
1. Enter command and all arguments: wc
2. Enter command and all arguments: wc -l
3. Enter command and all arguments: grep -i file.*