C++ :: Need A Function To Return A String
Aug 13, 2014I need a function to return a string..i need to pass input as "a,b,c,a,c,d,e" function should return out put as "a,b,c,d,e".
View 3 RepliesI need a function to return a string..i need to pass input as "a,b,c,a,c,d,e" function should return out put as "a,b,c,d,e".
View 3 RepliesI need a function to return a string
I need to pass input as "a,b,c,a,c,d,e"
function should return out put as
"a,b,c,d,e"
I'm trying to return a string to then call it on main function.
Code:
const char* coiso(int chave){
char str [50];
sprintf(str,"%d",chave);
char txt[50] = ".txt";
strcat(str,txt);
return str;
}
int main () {
const char* info = coiso(8);
printf("%s",info);
}
If I do a printf("%s",str) in coiso function it works but the following code doesn't work.
I've to use recursion function that return if the string has a same letters:
for example: - fff = true
- fFf = false
I did this but the return answer is always: NOT!
bool iSameLetters(char str[SIZE]) {
if(str[0]='