As the title says, in my program I (after many procedures) get tokenized words.
Unfortunately due to reversing them they hold punctuation characters at the beginning of a word eg. ,moose
How to move that , from the beginning to the end -> moose,
Up to now I’ve tried(ptr is char *):
temp = strdup(ptr);
temp = &ptr[0];
ptr[0] = ptr[1];
ptr[strlen(ptr)-1] = temp;
free(temp);
But that gives me errors:
assignment makes pointer from integer without a cast
warning: assignment makes integer from pointer without a cast
How to fix that?
Something like this:
Note that the above assumes
strto be valid.