I have to copy one string fromtoCode:const char s2[]All this is to be done without using the uber eliteCode:char s1[]library. So noCode:<cstring>. This is to be done within a function, so assume everything out of the function is properly done. My main question was, without using strcpy, or the cstring library, is there a more efficient way of doing this then I have listed here.Code:strcpy()
Thanks for any replies!Code:void strcat(char s1[], const char s2[]) { int i = 0; while ( (s1[i] = s2[i]) != '\O') i++; s1[i] = '\O'; // This line is not altogether necessary, but just helps anyway. }



LinkBack URL
About LinkBacks


