Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Avance de guia 4- Pregunta 1
Spring 2017 Project 2 v1.2
swap_talent.c
string.c
Example array of struct print
co_assign1_ques_4
void *
18BCE2182 ASSESS_3 Q3
150114_MatrizSumaPerimetro
18BCE2182 ASSESS_1 Q1-5
Please log in to post a comment.