: -----
i already got most of the problem but i still cant make the last if statement of "after finding a ; character" i would like to print Comentaries : (any token after a ;) but when i tryed to put it on a if alll i get is a new Character[i]:(anything after the ;) i have tryed for like 2 hrs and i dont know what else can i do to fix this cna some1 please help me?
heres my code:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <ctype.h> /* * || */ int main() { char word[256]; fgets(word,256,stdin); char *result; while (result != NULL) { int i=0; char delimit[]="\n , ;"; result=strtok (word,delimit); if (word[0] != 32 && word[0] != 9) { printf("Label \"%s\"\n", result); result = strtok (NULL, "\n , ;"); } printf("Instruction \"%s\"\n", result); result = strtok (NULL, "\n , ;"); for (i = 0; i < result; i++) { printf("Character [%d]\"%s\"\n",i, result); result = strtok (NULL, ", ;"); } if(word[0] == 59) { printf("Comentaries \"%s\"\n",result); result = strtok (NULL, ";"); } result = NULL; } return(0); }