hello guys. i am trying to do some question at the back of the chapter.
determine whether each of teh following is true or false. if false, explain why.
1) An array definition reserves space for an array.
2) To indicate that 100 locations should be reserved for integer array p, you write the declaration
p[ 100 ];
3) A for statement must be used to initialize the elements of a 15-element array to zero.
4) Nested for statements must be used to total the elements of a two-dimensional array.
the first one is true. correct me if iam wrong.
the third is false since you could initiaze during array declaration using initializer list. correct me if am wrong.
i am very much blank in the second and fourth. any suggestions?
array
Started by kumamako, Jul 17 2009 03:55 AM
3 replies to this topic
#1
Posted 17 July 2009 - 03:55 AM
|
|
|
#2
Posted 17 July 2009 - 07:26 AM
First, it depends on whether this is C or C++.
#3
Posted 17 July 2009 - 02:53 PM
c++
#4
Posted 17 July 2009 - 04:36 PM
You are correct on 1 and 3. Apply your logic for 3 to 4. The easiest way to test 2 is to try it with warnings on.


Sign In
Create Account


Back to top









