cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
C++ version of calloc
C++ version of calloc
Jun 24, 2011 at 1:08pm UTC
Bezi
(24)
In C we can use
calloc
to intialize a dynamically allocated array all to zero,
I am trying to avoid
calloc
and use
new
instead but I cannot initialize to zero. How is that possible?
Jun 24, 2011 at 1:32pm UTC
Moschops
(7244)
C++ 03 sections 5.3.4 and 8.5 refer.
You can do this:
new
int
[10]();
and the array will be initialised with zeros.
Topic archived. No new replies allowed.