If I leave some integer array items uninitialized I get sometime some strange numbers instead of zeros when I display the list of the array items.
Why is it happening?
Thank you.
skiabox
0
Light Poster
Recommended Answers
Jump to PostShort answer: Because you're leaving the elements in the array uninitialized.
Long answer:
Consider the following code snippet.int foo[10]; int main( void ) { static int bar[10]; int gus[10]; int i; for ( i = 0; i < 10; i++ ) { printf( "%d %d …
All 2 Replies
IsharaComix
97
Junior Poster in Training
Aia
commented:
Simple answer
+10
newbie_learner
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.