ok, quick question for those who know the standard well. when is a variable (and array and class object) set to 0 by default (all elements, all members) in C++. i know that if it's global it should be (is it?). are there any other cases?
invinate
0
Light Poster
Recommended Answers
Jump to PostI don't know the standard well at all. But I'd say it was always a good idea to intialise your variables, where ever they may be.
Jump to Postok, quick question for those who know the standard well. when is a variable (and array and class object) set to 0 by default (all elements, all members) in C++. i know that if it's global it should be (is it?). are there any other cases?
static also,
well u …
All 5 Replies
iamthwee
dubeyprateek
26
Junior Poster
WolfPack
491
Posting Virtuoso
Team Colleague
dubeyprateek
26
Junior Poster
invinate
0
Light 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.