GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

Week06 Quiz1

Eric White 16 Fragen

Quiz starten

Fragen in diesem Quiz (16)

  1. 1A pointer variable is designed to store
    1. Aany legal C++ value.
    2. Bonly floating-point values.
    3. Ca memory address.
    4. Dan integer.
    5. ENone of these
  2. 2Dynamic memory allocation occurs
    1. Awhen a new variable is created by the compiler
    2. Bwhen a new variable is created at runtime
    3. Cwhen a pointer fails to dereference the right variable
    4. Dwhen a pointer is assigned an incorrect address
    5. ENone of these
  3. 3When the less than ( < ) operator is used between two pointer variables, the expression is testing whether
    1. Athe value pointed to by the first is less than the value pointed to by the second
    2. Bthe value pointed to by the first is greater than the value pointed to by the second
    3. C the address of the first variable comes before the address of the second variable in the computer's
      memory
    4. Dthe first variable was declared before the second variable
    5. ENone of these
  4. 4Look at the following statement.
    int *ptr;
    In this statement, what does the word int mean?
    1. Athe variable named *ptr will store an integer value
    2. Bthe variable named *ptr will store an asterisk and an integer value
    3. Cptr is a pointer variable that will store the address of an integer variable
    4. DAll of these
    5. ENone of these
  5. 5The contents of pointer variables may be changed with mathematical statements that perform:
    1. Aall mathematical operations that are legal in C++
    2. Bmultiplication and division
    3. Caddition and subtraction
    4. Db and c
    5. ENone of these
  6. 6The _________ , also known as the address operator, returns the memory address of a variable.
    1. Aasterisk ( * )
    2. Bampersand ( & )
    3. Cpercent sign (%)
    4. Dexclamation point ( ! )
    5. ENone of these
  7. 7The statement cin >> *num3;
    1. Astores the keyboard input into the variable num3.
    2. Bstores the keyboard input into the pointer called num3.
    3. Cis illegal in C++.
    4. Dstores the keyboard input into the variable pointed to by num3.
    5. ENone of these.
  8. 8What will the following statement output?
    cout << &num1;
    1. AThe value stored in the variable called num1.
    2. BThe memory address of the variable called num1.
    3. CThe number 1.
    4. DThe string "&num1".
    5. ENone of these
  9. 9Which of the following statements is not valid C++ code?
    1. Aint ptr = &num1;
    2. Bint ptr = int *num1;
    3. Cfloat num1 = &ptr2;
    4. DAll of these are valid
    5. EAll of these are invalid.
  10. 10The statement
    int *ptr = new int;
    1. Aresults in a compiler error.
    2. Bassigns an integer less than 32767 to the variable named ptr.
    3. Cassigns an address to the variable named ptr.
    4. Dcreates a new pointer named int.
    5. ENone of these

Informationen

Beschreibung
Quiz am Week06 Quiz1, erstellt von Eric White am 06/08/2015.
Sprache
English
Aufrufe
1
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck