Search:
Forum
General C++ Programming
C++ version of calloc
[try Beta version]
Not logged in
register
log in
user name:
password:
remember me
forgot your password?
or sign in using:
try again
cancel
forgot your password?
C++ version of calloc
Jun 24, 2011 at 1:08pm
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
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.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs