Tuesday, July 14, 2009

C++ programing this is part of my study guide and im not sure if my answers are right could you help me out?

1.The arguments in a function call must match the arguments in


the function's header


a)only when the function call is in a different file from the function body.


b)in number, order, and variable name.


c)in number and order only.


d)in number, order, and type.


e)They don't have to match the header, only the function prototype.


2.To use I/O redirection to read from a file you need to:


a.declare a file variable in your program and openit


b.use the full path name with cin (a:\file1.dat.cin %26gt;%26gt;)


c.run your program from dos and add the file to be read from with the correct operator ( myprog %26lt; file1.dat)


d.any of the above will work


3.If you try to explicitly open an ifstream or ofstream file, how can you tell if the file opened successfully?


a.use the fail() function (method)


b.a return code of 1 indicates success


c.a pointer to a buffer that will receive data will be null if it fails


d.there is no way to tell other than to try to do input of output


e.a return code of 0 for success

C++ programing this is part of my study guide and im not sure if my answers are right could you help me out?
1-d


2-b


3-c





Please select best answer if all are correct


No comments:

Post a Comment