>> warningassing arg 1 of `strtok' makes pointer from integer without a cast
what does this mean
>> warningassing arg 1 of `strtok' makes pointer from integer without a cast
what does this mean
Post some code because apparently it doesn't like the type of data you are supplying as an argument.
Code:char Puzzle() { char clues[46][60] = {"BEFORE AND AFTER % WHITNEY HOUSTON TEXAS", "BEFORE AND AFTER % FAIR AND SQUARE DANCE", "FOOD AND DRINK % WHITE CHOCOLATE MOUS$ gets(clues[Rand_NUM(0,45)]); } //////////////////////////////////// //Printing the puzzle&phrase/////////////// //////////////////////////////////// char print_puzzle() { char *ptr; char ph_clue; ph_clue= Puzzle(); ptr = strtok(ph_clue,"%"); printf("Phrase:%s\n\n",ptr); if (ptr!= NULL) { ptr = strtok(NULL,","); printf("Puzzle:%s\n\n",ptr); } }
im trying to call a function within a function
strtok wants a string (char*) - you give just char
Puzzle()
does not have a return
gets - should not be used - read FAQ
you are using it incorrectly anyway - read FAQ how to get string from user
and do not return pointer to local var (if you ever plan to do it)
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
i knew i had to return something but im not sure what it should be.