#include<stdio.h> void copy_string(char*, char*); main() { char source[100], target[100]; printf("Enter source string\n"); gets(source); copy_string(target, source); printf("Target string is \"%s\"\n", target); return 0; } void copy_string(char *target, char *source) { while(*source) { *target = *source; source++; target++; } *target = '\0'; }
Hay friends .. AREA OF LANGUAGE IS TOO WIDE BUT NOW APPROXIMATE THEORY AND "C PROGRAMING CODES" ARE AVAILABLE . GOPAL KRISHNA "CHAUHAN"
Friday, 21 September 2012
c program to copy a string using pointers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment