Home » Community » Newbie corner » [solved]An U++ equivalent of bzero ? (if not a sin) (Can I bzero a flat array of double, or should I use some container template instead?)
[solved]An U++ equivalent of bzero ? (if not a sin) [message #52637] |
Sat, 02 November 2019 19:34  |
xrysf03
Messages: 43 Registered: November 2018 Location: CZ
|
Member |
|
|
Dear gentlemen,
while messing with my toy proggie, I've reached a point where I need to initialize an array of "double" (the double-length floating point type) - as an accumulation buffer of sorts.
Defined roughly as
double my_accu_buf[SOME_PARTICULAR_INTEGER_SIZE];
Can I just use the bzero() function that I know from GNU Libc? The MinGW compiler behind U++ cannot find that function, even if I #include <strings.h> . Ahaa, memset() does work (I don't even need to #include <string.h>). It's true that "man bzero" says "nono, deprecated, use memset() instead". Or is there some U++ equivalent? Or, should I refrain from using the unsafe and ugly, plain old C arrays, and use some container template instead? Such as the Vector... And of course I can just iterate across the array, but that feels so *meh* 
Come to think of that, if I zero-pad the storage allocated behind a "double", do I actually achieve the same as
Recommendations welcome 
Frank
[Updated on: Tue, 12 November 2019 22:18] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 13 18:13:12 CEST 2025
Total time taken to generate the page: 0.05213 seconds
|