void word_print(char * array,int begin){ if(begin != 0 || *(array+(begin-1)) != ' '){ while( *(array+begin)!=' ' && *(array+begin)!='.' && *(array+begin)!=',' && begin != 0){ begin= begin - 1; } } while( *(array+begin)!=' ' || *(array+begin)!='.' || *(array+begin)!=',' || *(array+begin)!='\0'){ printf("%c",*(array+begin++)); } } At the input of the function comes a string and an integer value that indicates the word to be printed.
The problem is that the second cycle with word_print("1234 56", 7); the arguments are infinite, although the while condition should work