Here is the relevant code:
#define _GNU_SOURCE
#define BUFFER_SIZE 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
while (1) {
char* buffer;
size_t size = 32;
size_t line;
line = getline(&buffer,&size,stdin);
printf("%s\n",buffer);
int commandList[line];
int count = 0;
while (strsep(buffer," ")) {
commandList[count] = strsep(buffer," ");
count++;
}
}
}
I am using Code Blocks with minGW and Clang.
I know some of my code does not do what it is supposed to at the moment, but I am pretty sure it should at least compile. I am also getting a warning: "implicit declaration of function 'strsep'".