Write a C program to copy one string to another without using string manipualtion fucntion
#include <stdio.h>
#include <stdlib.h>
//The start point of the program
int main() {
char inputString[1000];
char copyString[1000];
int i;
printf("Enter any string: ");
gets(inputString);
/* Copy text1 to text2 character by character */
for(i=0; inputString[i]!='\0'; i++)
{
copyString[i] = inputString[i];
}
copyString[i] = '\0';
printf("Copy string: %s\n", copyString);
//delay
getchar();
getchar();
return 0;
}
Comments
Leave a comment