Yes.so is the original code for those 2 lines correct like I originally thought?
Yes.so is the original code for those 2 lines correct like I originally thought?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
You don't really need that asterisk.Code:while(p1 = '\0') { p2 = p1; *p1++; p2++; }
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
You can do this a whole lot easier by just writing it this way:
Code:char * cpystr (char * strDest, char * strSource) { return strcpy(strDest, strSource); }
If you understand what you're doing, you're not learning anything.
Oh no you can't, not without <string.h>.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
ok, thanks for the help everyone. I think I got it. I've been looking at it all day and I understand all the things that were wrong with it. this string stuff is weird to me though so that's the reason I've needed help with it. again though, thanks for the help. I appreciate it.