# 電機一乙 11128271 蔡嘉泓 U-10 5/9 Hackmd作業 ## Pointer2 try to write a function to concatenate strings. void mystrcat ( char *dst, const char *src ); Test example: char a[100] = "Hello"; char b[100] = "John"; mystrcat (a, ", "); mystrcat (a, b); printf("%s", a); ```c= #include <stdio.h> void mystrcat ( char *dst, const char *src ); int main() { char a[100] = "Hello"; char b[100] = "John"; mystrcat (a, ", "); mystrcat (a, b); printf("%s", a); return 0; } void mystrcat ( char *dst, const char *src ) { while (*dst) dst++; for(; (*dst=*src)!=0; ) { dst++; src++; } } ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up