Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C question

Name: Anonymous 2017-04-14 17:09

is a byte with all zeros equivalent to the integer value (signed or unsigned) zero, in terms of portability?

Such that, is memset(&i, 0, sizeof(int)); equivalent to i = 0;?

Name: Anonymous 2017-04-18 12:25

>>13
No, i'm saying that memset is much more complex than setting ints to 0, despite the reduced case of it being the same.
Using memset(with its different implementation) as some magical portability layer actually create more difference than just using i=0. There would be performance differences, rare bugs(you can't rely on C code larger than 10 lines completely) and corner cases where memset does something unexpected or does it much slower.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List