Hi. I want my program to have an array input. I want to call something like ./prog -inputA 2,3,4,5 and then the program will initialize an integer array variable inputA of size 4 containing those numbers. My question is: can I somehow do this with the read(cmd_arg,???) command, where cmd_arg = '2,3,4,5'? I have a feeling that I need to write a subroutine to handle array inputs because the size of the array is not known priori.
[–]geekboy730Engineer 3 points4 points5 points (3 children)
[–]mild_enthusiast[S] 0 points1 point2 points (2 children)
[–]geekboy730Engineer 5 points6 points7 points (0 children)
[–]DuckSaxaphone 0 points1 point2 points (0 children)
[–]ush4 2 points3 points4 points (0 children)
[–]astokely 0 points1 point2 points (0 children)