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

Karteikarten

Language Basics Flashcards

Oscar Rojas Computer Science Englisch 11 Karten

Karten in diesem Stapel (11)

  1. 1How do you access a function/class in the Standard Library?By using the "std" namespace followed by two semi-colons "::"
  2. 2As a good rule of thumb, how should you gain input from the user?By using "std::getline( cin, std::string var);"
    (to be noted that the input it saved as a string in the var)
  3. 3Convert n into its numerical value given: #include #include // Allows for use of strings std::string n; int num; std::cout<<"Enter a #"<< std::endl; std::getline(std::cin, n);#include
    #include // Allows use of strings
    #include //"stringstream"
    std::string n;
    int num;
    std::cout<<"Enter a #"<< std::endl;
    std::getline(std::cin, n);
    std::stringstream(n) >> num;
  4. 4How do you get the size of a type & what will it be measured in?sizeof(var); // returns size in bytes (8 bits)
  5. 5Void is an incomplete type, as a result what may be disallowed?Objects, arrays & references
  6. 6What are the differences between signed & unsigned types?unsigned types are 2x as big, in value range, but ignore the sign.
    (Range: [0, 2x])
  7. 7How would you resize an int?precede it with "__type n"
    (where n = the # of Bytes)
    or
    use types "short" to shrink & "long" to expand
  8. 8what is the range of values an int (__int32) may hold?[ -2,147,483,648 , +2,147,483,648 ]
  9. 9List the floating point types from least to most accurate:float, double, long double
  10. 10What is the size of int, long & pointer in 32-bit Systems?int is 16 bits, while long & pointer are 32 bits.
    or
    int, long & pointer are 32 bits
  11. 11What is the size of int, long & pointer in 64-bit Systems?int & long are 32 bits, while pointer is 64 bits.
    or
    int is 32 bits, while long & pointer are 64 bits

Informationen

Beschreibung
Includes control io, safer forms of input, type sizing & ranges.
Erstellt von
Oscar Rojas
Aufrufe
9
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck