when I implement the function
char *strchr( const char *string, int c );
I got a problem. If I wrote like this:
char *my_strchr(const char *string, int c)
{
while(*string && *string!=c){
string++;
}
return string;
}
I was told the string is const char*, and the return value is char*...
Q: Write a function to print all of the permutations of a string.
A: I wrote a recursive function to fulfill this. I was wondering if there's a better way to do this? either simpler or having less Runtime...
Thanks!
#include <string.h>
#include <iostream.h>
/*Remove one character from str*/...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.