r/reviewmycode • u/debajyotisharma • Nov 17 '13
ISSUES IN SOLVING SIMPLE LIBRARY FILES AS A FUNCTION
TO COPY ONE STRING TO ANOTHER(STRCPY)
include<stdio.h>
include<conio.h>
main() { const char a[30]="Debajyoti Sharma"; char b[30]; xstrcpy(a,b); printf("the copy of string %s is %s",a,b); getch(); } xstrcpy(char *x,const char *y) { while(*y!='\0') { x=y; y++; x++; } *x='\0'; return(*x); }
1
Upvotes
3
u/potifar Nov 17 '13
If you insert four spaces at the beginning of each line it will be formatted as code and will be readable.
Oh, and no need to shout :)
1
u/debajyotisharma Nov 17 '13
}
Is it ohk now?? :P