Language Basics Flashcards

Descrição

Includes control io, safer forms of input, type sizing & ranges.
Oscar Rojas
FlashCards por Oscar Rojas, atualizado more than 1 year ago
Oscar Rojas
Criado por Oscar Rojas mais de 4 anos atrás
0
0

Resumo de Recurso

Questão Responda
How do you access a function/class in the Standard Library? By using the "std" namespace followed by two semi-colons "::"
As 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)
Convert n into its numerical value given: #include <iostream> #include <string> // Allows for use of strings std::string n; int num; std::cout<<"Enter a #"<< std::endl; std::getline(std::cin, n); #include <iostream> #include <string> // Allows use of strings #include <sstream> //"stringstream" std::string n; int num; std::cout<<"Enter a #"<< std::endl; std::getline(std::cin, n); std::stringstream(n) >> num;
How do you get the size of a type & what will it be measured in? sizeof(var); // returns size in bytes (8 bits)
Void is an incomplete type, as a result what may be disallowed? Objects, arrays & references
What are the differences between signed & unsigned types? unsigned types are 2x as big, in value range, but ignore the sign. (Range: [0, 2x])
How would you resize an int? precede it with "__type n" (where n = the # of Bytes) or use types "short" to shrink & "long" to expand
what is the range of values an int (__int32) may hold? [ -2,147,483,648 , +2,147,483,648 ]
List the floating point types from least to most accurate: float, double, long double
What 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
What 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

Semelhante

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr