C++ :: Function To Return String - File Size
Feb 24, 2012Where i can get ready function, which return string, which describe size of file?
For example
4 = 4 b
1045 = 1,01 Kb
and etc.
Where i can get ready function, which return string, which describe size of file?
For example
4 = 4 b
1045 = 1,01 Kb
and etc.
I 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 Replies View RelatedI 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]='