I am trying to write my own type of argv that puts arguments into a an array, commands[]. I want to use this in a menu shell in a program. An example:
shell> create “an message with spaces”
When typing this in the menu the command array should have length 2.
command[0] = create
command[1] = an message with spaces
Sow when we have a sentences between “ and “ the code wont distinguish(create an new array element) when we have a space.
How can we do that ?
This code will read a line from the terminal, but how can I put the sentences in a array?Code:while (fgets(line, LINE_MAX, stdin) != NULL) { command = line; }



LinkBack URL
About LinkBacks



