C Program to Copy String Without strcpy

This C program copies string without using string handling function strcpy().

C Source Code: String Copy Without strcpy()


int main()
	char str1[30], str2[30];
	int i;

	printf("Enter string:\n");

		str2[i] = str1[i];

	str2[i] = '\0';

	printf("Copied string is: %s", str2);

	return 0;


Enter string:
Welcome to C ↲
Copied string is: Welcome to C

Note: ↲ represents ENTER key is pressed.