I have 2 strings.
char* a = "hi";
char* b = "";
How can I use strcpy to copy string a to string b?
please provide me the codes and give me explanation if possible.
Thank you very much.
I have 2 strings.
char* a = "hi";
char* b = "";
How can I use strcpy to copy string a to string b?
please provide me the codes and give me explanation if possible.
Thank you very much.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
printf("%s\n%s\n"); - something is missing. Two somethings...
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Perhaps better questions are;
1. Why didn't you use strncpy()
2. Where does 309 come from?
For copying the string from source to destination.
always better use strncpy --> so that overflow can be avoided.