1 / 9

Test 1 Review

Test 1 Review. Arrays. What is an array? What is name of the array? What is index? What is indexed variable? Element of the array? What is array size? What is array’s base type? How is array declared? What do number indexes start from? Can compiler detect an out-of-range index?

tulia
Télécharger la présentation

Test 1 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test 1 Review

  2. Arrays • What is an array? • What is name of the array? What is index? • What is indexed variable? Element of the array? • What is array size? • What is array’s base type? • How is array declared? • What do number indexes start from? • Can compiler detect an out-of-range index? • Can arrays be passed as arguments to functions? If yes by value or by reference? If yes, how’s size of array passed? • What does const mean in the following declaration? void myfunc(const int []);

  3. Pointers • What is variable address, name, value? • What is a pointer? • How is a pointer declared? • What is address-of and dereference operators? • How can a pointer be assigned a value? • How can a value of a memory location referred to by a pointer be accessed? • What is a constant pointer? What is a pointer to a constant? • What is the relationship between array name and a pointer? • What is null pointer? What is lose pointer problem? • Can pointers be used with objects? How can a method be invoked on an object using pointer? • What is -> operator?

  4. Dynamic memory allocation • What is static and dynamic variables? Why are dynamic(ally allocated) variables needed? • What is a heap? how is it used? • What is new and delete operations? How are they used? • How does one access a dynamically allocated variable? How does one assign a value to such variable at declaration time? • How can a pointer be passed to a function? • How does one create an array dynamically? • How to release memory?

  5. Review on Strings • which header file needs to be included for string manipulation? • how’s a string assigned a value? Can a string be initialized at declaration? • what’s the difference in string input between getline() and extraction operator? • how are strings compared, concatenated? • how can the size of a string be determined?

  6. File I/O • what is stream? • what is the difference between input stream and output stream? • how can a stream be defined? • what do the following functions do? • open()close() • c_str() eof()fail()exit() • can a stream be passed as a parameter?

  7. Structures • what’s a structure? what’s the keyword to define a structure? • what are structures used for? • is a structure definition an executable statement? Can it be put in a header file? • why includeing a header file with structures definition multiple times is a problem? how is this problem solved? • what are #define #ifndef #endif? • what is a structure variable? • how are elements of a structure called? • do elements of the same structure (different structures) have to have unique names? • how can structures be initialized? what happens when one structure variable is assigned the value of another? • can structures be passed as parameters? by value? by reference? can a function return a structure?

  8. Classes • What is class? What is object? • What is the difference between object and class? What do we mean when we say object belongs to a class? • What’s member variable? Member function? Method? Attribute? Data member? • What’s an in-line function? • What are these operators used for? “.” “::” • What is the difference between public and private members of class? • What is the state of an object?

  9. Classes (cont.) • What is mutator? Accessor? How’s accessor function distinguished? • What is constructor? What is the name of constructor? • How many parameters can constructor take? Can there be more than one constructor? What is void constructor? • What is the return value of constructor? • What is destructor? • What is overloading member functions?

More Related