Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PtStrCpy
//gcc 7.4.0 //PtStrCpy: user defined strcpy() and printing the result function where pointer arithmetic is employed; //this code is created by Rezaul Hoque on March 27,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <stdio.h> #include <string.h> #include <stdlib.h> void cpy(char*,char*); void disp(char*); void cpy(char* dest,char* source) { for(int i=0; *(source+i);i++) *(dest + i)= *(source+i); } void disp(char * p){ int k; for(k=0; *(p+k);k++) printf("%c",*(p+k)); printf("\n"); } int main() { char a[26]; char c[13]="How are you?"; cpy(a,c); disp(a); return 0; }
run
|
edit
|
history
|
help
0
part 3
FILE_operations
18BCE2182 ASSESS_3 Q3
strrev
Midterm practice, turn into for loop
ptr_to_ptr
tremendo codigaso ayudantia
quadsort vs qsort
C141105_SwitchNotas
A_141201_MatrizTodosDistintos