#include #include #include int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: ./depth \n"); exit(EXIT_FAILURE); } FILE *fp; char *buffer; ssize_t read; size_t len = 0; fp = fopen(argv[1], "r"); if (fp == NULL) { perror("fopen"); exit(EXIT_FAILURE); } int scalar; char *way; while ((read = getline(&buffer, &len, fp)) != -1) { sscanf(buffer, "%s %d", way, &scalar); // printf("READ: <%s>, <%d>\n", way, scalar); if (strncmp(buffer, "forward", strlen(buffer))) { } } return 0; }