reserve string in c
-
hello i want reserve string in c just using(string.h) such strcat and strcpy and strcmp libirty without (for or poniter) how???
-
hello i want reserve string in c just using(string.h) such strcat and strcpy and strcmp libirty without (for or poniter) how???
Hi, I thing when you say poniter its pointer. All strings and arrays in C are pointers so you cant change it. However if you want to create a string otherwise you can use malloc, with malloc you can create one array of any size, you can see it here But you have other way to do it, if you want to read a string for keyboard you may be need to use strdup() from string.h
-
Hi, I thing when you say poniter its pointer. All strings and arrays in C are pointers so you cant change it. However if you want to create a string otherwise you can use malloc, with malloc you can create one array of any size, you can see it here But you have other way to do it, if you want to read a string for keyboard you may be need to use strdup() from string.h
hay i want reserve without chang index for array exmple with change index:
char array[20]; int i,j; gets(array); j=strlen(array); for(i=j-1;i>=0;i--) {printf("%c",array[i]) } i want use (strncat & strncpy with for)...for Reverse string but i don't know how i can do this :: ex ::
char array[20]; int i,j; j=strlen(array); for(*******) { strncat(****) or strcat(***) or strncpy(***) or strcpy; } and in the end i want Reverse string :^) :^)
-
hay i want reserve without chang index for array exmple with change index:
char array[20]; int i,j; gets(array); j=strlen(array); for(i=j-1;i>=0;i--) {printf("%c",array[i]) } i want use (strncat & strncpy with for)...for Reverse string but i don't know how i can do this :: ex ::
char array[20]; int i,j; j=strlen(array); for(*******) { strncat(****) or strcat(***) or strncpy(***) or strcpy; } and in the end i want Reverse string :^) :^)