Hello..
Is this
memset(buf, 0, sizeof(buf));
the same as:
memset(buf, '\0', sizeof(buf));
?
If no, whats the difference?
Hello..
Is this
memset(buf, 0, sizeof(buf));
the same as:
memset(buf, '\0', sizeof(buf));
?
If no, whats the difference?
They're the same.
If you understand what you're doing, you're not learning anything.
Yes, they're the same.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
And for good measure, Yes, it's really true, they're exactly the same thing!
See the FAQ: http://faq.cprogramming.com/cgi-bin/...&id=1043284376
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.