#include<stdio.h> void concatenate_string(char*, char*); main() { char original[100], add[100]; printf("Enter source string\n"); gets(original); printf("Enter string to concatenate\n"); gets(add); concatenate_string(original, add); printf("String after concatenation is \"%s\"\n", original); return 0; } void concatenate_string(char *original, char *add) { while(*original) original++; while(*add) { *original = *add; add++; original++; } *original = '\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
String concatenation without strcat
Subscribe to:
Post Comments (Atom)
while (*original++);
ReplyDeletewhile (*original++=*add++);
above code will complete ur job.
good .....
Delete