Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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?)
Re: An U++ equivalent of bzero ? (if not a sin) [message #52646 is a reply to message #52637] Sun, 03 November 2019 22:34 Go to previous messageGo to previous message
xrysf03 is currently offline  xrysf03
Messages: 43
Registered: November 2018
Location: CZ
Member
Actually come to think of that... what if I allocate the buffer dynamically?

double* array_ptr = new double[some_calculated_size];


Will Upp::Zero() know the right size, by any chance? (Talk to the allocator behind the scenes? That would not be very good as a general approach, as in general a pointer needn't point to the beginning of an allocated chunk of memory, it can point to someplace inside an allocated buffer etc.) = I guess I'd better decide whether to use a proper container, or use manual iteration, or stick to memset()...

BTW that floating-point literal zero, written as 0.0, that's a nice trick I didn't know about, thanks Klugier Smile
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] Empty values to the "EditInt" widget and the "int" basic type
Next Topic: Upp::Vector FindIndex by value of Object
Goto Forum:
  


Current Time: Tue May 13 17:53:20 CEST 2025

Total time taken to generate the page: 0.00975 seconds