Writing a little command-line script at the moment, and I’ve got it working pretty nicely.
The script loops until the user issues an exit command, during which the user can enter commands like so:
I 5 6
It denotes an image creation; 5 and 6 are the width and height to be created.
As it stands I can’t seem to capture the user’s input in an array. I can always get the first letter but never the other two with fgetc.
Currently capturing like this:
$input = strtolower(fgetc(STDIN));
Can somebody lend a hand?
fgetc() only reads one caracter, fgets() reads a string