• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/6

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

6 Cards in this Set

  • Front
  • Back

How can we access standard library?

2 ways:


1. qualify every lib we want to use:


'std::cout'



2. introduce visibility of these components is by means of using declarations


'using namespace std;'


then we can do something like 'cout' without typing 'std::' in front of it every time.


*all elements in the std namespace to be accessed in an unqualified manner (without thestd:: prefix).



Recall: if you don't want to import, you will just have to type.


Define variable. What does each one need?

- define variable as a portion of memory to store a value.



Each one need:


- different name (i guess it's just like primitive or reference variable in Java)


what is 'Identifier'?

it's just naming convention used on each variable.


- pretty much like JAVA naming



*The C++ language is a "case sensitive" language. That means that an identifier written in capital letters is not equivalent to another one with the same name but written in small letters.



* Spaces, punctuation marks, and symbols cannot be part of an identifier.

Difference btw each data type:

1. int and long don't occupy the same amount of memory .


- the only diff btw short, long, int, bit, byte, float is ' their size'.


- Other than that, the types in a group have the same properties.



- the type is not required (and in many cases is not) exactly this minimum size. (i.e. C++ int, long, float size doesn't stay fixed, it has min point but the program can reset it)

What is important about the size of the data size (byte/ bit)?

- the more bits a type has, the more distinct values it can represent, but at the same time, also consumes more space in memory



- For floating-point types, the size affects their precision, by having more or less bits for their significant and exponent.



Which data types to use?

1. Default: If the size or precision of the type is not a concern, then char, int, and double are typically selected to represent characters, integers, and floating-point values, respectively. The other types in their respective groups are only used in very particular cases.



2. for other data types, we need to look at the problem and be more specific.