Thread
:
Init array with a non-zero value
View Single Post
Apr 15th, 2008, 11:16 PM
#
2
mbd
Programmer
Join Date: Nov 2007
Posts: 86
Rep Power:
1
Re: Init array with a non-zero value
c++ Syntax
(
Toggle Plain Text
)
#include <algorithm>
...
int
variable
[
10
]
;
std::
fill_n
(
variable,
10
,
9
)
;
#include <algorithm> ... int variable[10]; std::fill_n(variable, 10, 9);
still just a loop under the hood
mbd
View Public Profile
Find More Posts by mbd