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 address-of operator. it is used to assign pointers and to print the address of variables.






2. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.






3. The ________ enables access to a global variable with the same name as a variable in the current scope.






4. A type of pointer that can point at objects of any data type.






5. 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.






6. * / % + -






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






8. Names of things that are used in a program - can apply to variables & constants and functions






9. Use 2 characters to represent one






10. An array that uses two subscripts is referred to as a(n) _________ array.






11. A program that finds and attaches to your program the indicated libraries for compilation






12. Every C++ statement ends with a(n) _________.






13. The ________ of an identifier is the portion of the program in which the identifier can be used.






14. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call






15. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.






16. This is used to mark the end of a complete C++ programming statement.






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






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






19. data types that refer to numbers with decimals






20. directive A statement that starts with a # is called a ____________.






21. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.






22. Two slash marks ( // ) indicate __________ of a comment






23. Class members specified as _________ are accessible only to member functions of the class and friends of the class.






24. The symbol for the binary scope resolution operator






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






26. Operator with two operands






27. The process of placing the elements of an array in order is called ________ the array.






28. Most calculations are normally performed by ______ statements.






29. int namespace include using return examples of ___________






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






31. Compares two strings and returns 0 if they are equal.






32. To write data to a file you define an object of which one of the following






33. The stream extraction operator






34. The modulus operator (%) can be used only with __________.






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






36. A function is invoked with a ________.






37. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.






38. These are data items whose values do not change while the program is running






39. Message displayed to the screen asking user for input; generated with an output statement






40. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.






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






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






43. All ______ must be declared before they are used.






44. An expression that has operands with different data types






45. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .






46. Type casting syntax






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






48. A function ________ enables a single function to be defined to perform a task on many different data types.






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






50. The process of determining if an array contains a particular key value is called _________ the array.