12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

502 Appendix A<br />

Day 1<br />

1. There is no ma<strong>in</strong>() function. Every program must have a ma<strong>in</strong>() function.<br />

2. One. A function can have many parameters but can only return one value.<br />

3. The strcpy() function copies the contents of one str<strong>in</strong>g to another.<br />

4. You never know. A variable will conta<strong>in</strong> random data until it is <strong>in</strong>itialized.<br />

5. There is no limit to the number of functions a program can have.<br />

6. Yes.<br />

7. There is no function declaration for the doSometh<strong>in</strong>g() function.<br />

8. One.<br />

9. 19 characters plus the term<strong>in</strong>at<strong>in</strong>g NULL.<br />

10. Zero.<br />

Day 2<br />

1. The statement immediately follow<strong>in</strong>g the if statement. If a code block follows an<br />

if statement, the entire code block will be executed.<br />

2. The first parameter is the start<strong>in</strong>g value, the second parameter is the test expression,<br />

and the f<strong>in</strong>al parameter is the <strong>in</strong>crement parameter.<br />

3. A while loop checks the conditional expression at the beg<strong>in</strong>n<strong>in</strong>g of the loop. A<br />

do-while loop checks the conditional expression at the end of the loop.<br />

4. The break statement is used to break out of a loop. The statement follow<strong>in</strong>g the<br />

loop will be executed follow<strong>in</strong>g a break statement. The cont<strong>in</strong>ue statement forces<br />

program execution back to the top of the loop.<br />

5. A global variable is one that is <strong>in</strong> scope anywhere <strong>in</strong> the program. It can be accessed<br />

by any function <strong>in</strong> the program.<br />

6. Yes. A structure can conta<strong>in</strong> any number and type of data members.<br />

7. With the direct member operator (.). Here’s an example:<br />

record.LastName = “Noble”;<br />

8. Yes.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!