Tuesday, July 28, 2009

More c++ help?

1.What is the proper way to create an array of structs oftype acct_t?


a.my_array acc_t[10];


b.acc_t my_array[10];


.acct_t struct my_array[10];


d.struct my_array[acct_t];


2.Structures must have members that are of the same data type.


a. true


b. false


3.If f is a double variable, what is the value of the expression (int) f ?


a.is rounded (up or down) to the nearest integer.


b.f is truncated (down) to the nearest integer.


c.The expression declares f as an integer.


d.f may be rounded or truncated at random.


e.The expression is illegal.


4.The preferred way to alter an object's data member from code outside the object is to


a.use a "constructor"


b.use a "public access method"


c.directly alter the data member via the object.datamember notation


d.use a "mutator"


5.Suppose I call a function as follows:





MyFunction(%26amp;H);


Which of these might be the prototype for MyFunction?


a.void MyFunction(* int);


b.void MyFunction(int %26amp;)


c.void MyFunction(int);


d.void MyFunction(int *);


e.None of the above

More c++ help?
Man, you are just too lazy to look up the answers in your text book, aren't you?





Or are you doing this live, during the test?


No comments:

Post a Comment