Is there any way by which I can initialize all the elements of an array(already declared) in one statement?? That is, without using loops
illuminatus89 0 Newbie Poster
Recommended Answers
Jump to PostYou can't initialise anything that has already been declared. You can only initialise something at the time it is created, after that it becomes assignment.
And to answer the spirit of your question no there is no way to assign to all members of an existing array without recourse …
Jump to PostYou can't initialise anything that has already been declared. You can only initialise something at the time it is created, after that it becomes assignment.
Not true. By setting a value, (for example- a loop counter before a while loop) is initializing the value.
Jump to PostI guess the terminology has changed, then. For the past 35 years initializing a variable has been setting it to a know value just before entering a piece of code (like a loop) that does some kind of processing. When did that change?
What you call initializing I always …
All 9 Replies
Banfa 597 Posting Pro Featured Poster
anirudh33 -4 Light Poster
.It. 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Dexxta27 14 Junior Poster in Training
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Dexxta27 14 Junior Poster in Training
chaitanya88 -1 Newbie Poster
jonsca commented: spammer -1
benwilliams 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.