Test your basic knowledge |

C++ Programming Basics

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.






2. A function that can be used to read character data including whitespace






3. A________ allows the compiler to check the number & types and order of the arguments passed to a function.






4. Header file that contains commonly performed mathematical functions






5. The __________ operator reclaims memory previously allocated by new.






6. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.






7. The storage-class specifiers are mutable - auto - ________ - extern and static.






8. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.






9. __________ can be used to assign an object of a class to another object of the same class.






10. newline






11. Nonexecutable statements that are included in a program to provide information about what the program does etc.






12. The _________ begins the body of every function and the _________ ends the body of every function.






13. The three ways to return control from a called function to a caller are ________ - return expression and encounter.






14. To allow file access in a program you must #include this header file.






15. tab






16. In inheritance the ____________ is the class the receives the inherited members.






17. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors






18. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.






19. The symbol for the binary scope resolution operator






20. Returns the length of a string excluding the null terminator.






21. An expression that has operands with different data types






22. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.






23. For every opening brace in a C++ program there must be a ______________.






24. Initializers __________ must be used to initialize constant members of a class.






25. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.






26. When a value of one data type is implicitly (automatically) changed to another data type






27. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.






28. An operator that can only be used with int values. result will always be an int.






29. A constant object must be __________; it cannot be modified after it is created.






30. Grammar rules of the language; compiler will try to identify and locate syntax errors






31. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.






32. The ________ program transfers the executable image of a C++ program from disk to memory.






33. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.






34. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution






35. Used for dynamically allocated variables






36. A file must be ________ before data can be written to or read from it.






37. Used to qualify hidden names so that they can be used.






38. This manipulator causes the field to be left-justified with padding spaces printed to the right.






39. You can declare default values for a function in the ____________________.






40. Words that are used for special purposes in a program






41. Executable version of program






42. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.






43. A set of values together with a set of operations






44. Allows the programmer to store a value in a variable






45. The elements of an array are related by the fact that they have the same name and ___________.






46. A pointer is a variable that contains as its value the____________ of another variable.






47. A member function should be declared static if it does not access __________ class members.






48. Every C++ program begins execution at the function _________.






49. The sign you use for pointers






50. = & | are examples of ____________.