Japanese Kanji / Hiragana
君 ( きみ) You
私 ( わたし) I
僕 ( ぼく ) I
俺 ( おれ) I
あなた You
Sade Olutola
DEAR READER
he wasn't even looking at me and he found me

Andulka

blake kathryn

Product Placement
2025 on Tumblr: Trends That Defined the Year
art blog(derogatory)
trying on a metaphor
Cosmic Funnies

titsay
i don't do bad sauce passes
Misplaced Lens Cap
Not today Justin

shark vs the universe
Keni
AnasAbdin
$LAYYYTER
seen from United States
seen from Romania

seen from Bulgaria

seen from Peru

seen from Malaysia
seen from United States
seen from Canada

seen from Australia
seen from United States
seen from Canada

seen from United States
seen from Italy

seen from France
seen from United States
seen from United Kingdom
seen from Switzerland
seen from United States

seen from United States

seen from South Korea
seen from United States
@notesnerds
Japanese Kanji / Hiragana
君 ( きみ) You
私 ( わたし) I
僕 ( ぼく ) I
俺 ( おれ) I
あなた You

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Array:: Note 4
Two Dimensional Array declaration
dataType ArrayName[dimension Y][dimension X];
You may declare in this way:
double distance[2][4] = { 44.14, 720.52, 96.08, 468.78, 6.28, 68.04, 364.55, 6234.12 };
But to make it clear, it is advisable to use:
double distance[2][4] = { { 44.14, 720.52, 96.08, 468.78 }, { 6.28, 68.04, 364.55, 6234.12 } };
The array process for 2D is still similar to one dimensional array, except the reference will always involve arrayName [i][j].
Array:: Note 3
Array and Functions
Array can be passed to a function as an arguments. An array can also be returned to a function.
#include <iostream> using namespace std; void DisplayTheArray(double member[5]); int main() { const int numberOfItems = 5; double distance[numberOfItems] = {44.14, 720.52, 96.08, 468.78, 6.28}; return 0; } void DisplayTheArray(double member[5]) { for(int i = 0; i < 5; ++i) cout << "\nDistance " << i + 1 << ": " << member[i]; cout << endl; }
For a single dimensional array, you don't have to specify the size.
#include <iostream> using namespace std; void DisplayTheArray(double member[]); int main() { const int NumberOfItems = 5; double distance[NumberOfItems] = {44.14, 720.52, 96.08, 468.78, 6.28}; DisplayTheArray(distance); return 0; } void DisplayTheArray(double member[]) { for(int i = 0; i < 5; ++i) cout << "\nDistance " << i + 1 << ": " << member[i]; cout << endl; }
The compiler only needs the name of the array to process the array because the name of the array is acting as a pointer to the first location.
#include <iostream> using namespace std; void DisplayTheArray(double member[]) { for(int i = 0; i < 5; ++i) cout << "\nDistance " << i + 1 << ": " << member[i]; cout << endl; } int main() { const int numberOfItems = 5; double distance[numberOfItems] = {44.14, 720.52, 96.08, 468.78, 6.28}; cout << "Members of the array"; DisplayTheArray(distance); return 0; }
To pass a certain value from the array, simply use the nameofArray[index].
#include <iostream> using namespace std; void Display(double a) { cout << "\nDistance: " << a; cout << endl; } int main() { const int NumberOfItems = 5; double distance[NumberOfItems] = {44.14, 720.52, 96.08, 468.78, 6.28}; cout << "A Member of the array"; Display(distance[3]); return 0; }
Array:: Note 2
Array Operations
You can apply all the logical operations, bitwise operations and normal arithmetic operations.
See the following examples:
#include <iostream> using namespace std; int main() { // Declare the members of the array int numbers[] = {8, 25, 36, 44, 52, 60, 75, 89}; int find; int i, m = 8; cout << "Enter a number to search: "; cin >> find; for (i = 0; (i < m) && (Numbers[i] != Find); ++i) continue; // Find whether the number typed is a member of the array if (i == m) cout << find << " is not in the list" << endl; else cout << find << " is the " << i + 1 << "th element in the list" << endl; return 0; }
#include <iostream> using namespace std; int main() { // We know that we need a constant number of elements const int max = 10; int number[max]; // We will calculate their sum int sum = 0; cout << "Please type 10 integers.\n"; for( int i = 0; i < max; i++ ) { cout << "Number " << i + 1 << ": "; cin >> number[i]; sum += number[i]; } cout << "\n\nThe sum of these numbers is " << Sum << "\n\n"; return 0; }
// Example of finding the minimum member of an array #include <iostream> using namespace std; int main() { // The members of the array int numbers[] = {8, 25, 36, 44, 52, 60, 75, 89}; int minimum = numbers[0]; int a = 8; // Compare the members for (int i = 1; i < a; ++i) { if (numbers[i] < minimum) minimum = numbers[i]; } // Announce the result cout << "The lowest member value of the array is " << minimum << "." << endl; return 0; }
// Example of finding the maximum member of an array #include <iostream> using namespace std; int main() { // The members of the array int numbers[] = {8, 25, 36, 44, 52, 60, 75, 89}; int maximum = numbers[0]; int a = 8; // Compare the members for (int i = 1; i < a; ++i) { if (numbers[i] > maximum) maximum = numbers[i]; } // Announce the result cout << "The highest member value of the array is " << maximum << "." << endl; return 0; }
Array:: Note 1
An array is a group of item that is identified as similar because they are the same nature.
Declaring an array and Initialization
1.DataType arrayName[Size];
2.DataType arrayName[Size] = {itemA, itemB, itemC, etc};
3. DataType arrayName[]={itemA, itemB, itemC, etc};
Index of array
The following diagram will illustrate how an array is indexed. This illustration will demonstrate the one dimensional array.
Accessing array
We can use 'for' loop to access the array. Here is an example of a program:
#include <iostream> using namespace std; int main() { const int numberOfItems = 5; double distance[numberOfItems] = {44.14, 720.52, 96.08, 468.78, 6.28}; cout << "Members of the array\n"; for(int i = 0; i < numberOfItems; ++i) cout << "Distance " << i + 1 << ": " << distance[i] << endl; return 0; }
Sizing an array (The function sizeof)
Sometimes, you just want to put the items in but you don't want to count. This is where you can use the function sizeof.
The formula is to get the size of the array is:
DataType variableName = sizeof(arrayName)/sizeof(DataType);
The program below will teach you how to use sizeof.
#include <iostream> using namespace std; int main() { double distance[] = {44.14, 720.52, 96.08, 468.78, 6.28}; // Using the sizeof operator to get the dimension of the array int index = sizeof(distance) / sizeof(double); cout << "Array members and their values\n"; // Using a for loop to scan an array for(int i = 0; i < index; ++i) cout << "Distance : " << i + 1 << distance[i] << endl; return 0; }
Getting input from the user into an array
Simply use:
cin>> ArrayName[index];
This is the basic for one dimensional array and also array overall.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Bitwise Operators Note 2
Bit Shift Operators
This operators allows you to move bits in the direction of your choice.
The syntax is :: value<<ConstantInteger
When performing the operation, the compiler would “push” Value’s bits to the left by the number of ConstantInteger.
Example:::
The binary value of 42 is 0010 1010.
42 now is shifted by two bits.
The result of the shift will be 1010 1000 because the bit has shifted to the left by 2 box.
Bitwise Operators
Important idea: When a variable is declared, the computer will reserve a memory space for that variable.Bit operations allow you to control how values are stored in bits.
---
Bitwise NOT operator
This operator allows you to reverse the value. Bitwise NOT is unary operator that must be placed on the left side of the operand:
~value
SO, let's say that you have 11110000 . When you invert using ~, it will give you 00001111
---
Bitwise AND operator &
This operator evaluates the conjunction of two statements much like the truth table concept of conjunction.
The syntax is Operand1 & Operand2
Bit1|Bit2|Bit1 & Bit2
0 0 0
1 0 0
0 1 0
1 1 1
Imagine you have two byte values represented as 187 and 242. Based on our study ofnumeric systems, the binary value of decimal 187 is 1011 1011 (and its hexadecimal value is 0xBB). The binary value of decimal 242 is 1111 0010 (and its hexadecimal value is 0xF2). Let’s compare these two values bit by bit, using the bitwise AND operator:
Most of the times, you will want the compiler to perform this operation and use the result in your program. This means that you can get the result of this operation and possibly display it on the console.
Conditional Statements::Note 2
Switch statement
Switch statement is based on a possible outcome of an input to a variable. This possible outcomes is known as 'case'.
switch(Expression) { case Choice1: Statement1; case Choice2: Statement2; case Choice-n: Statement-n; default: Other-Possibility; }
#include <iostream> using namespace std; int main() { int Number; cout << "Type a number between 1 and 3: "; cin >> Number; switch (Number) { case 1: cout << "\nYou typed 1."; case 2: cout << "\nYou typed 2."; case 3: cout << "\nYou typed 3."; default: cout << endl << Number << " is out of the requested range."; } return 0; }
Conditional Statements::Note 1
Conditional statement is simply about the logical evaluation of an if A, then B statement. A is the condition while B is a statement of a process.
In programming, the if A, then B statement is structured in such a way:
if(condition A ) statement B;
Here is an example of a simple program:
#include <iostream> using namespace std; int main() { char Answer; char CreditCardNumber[40]; // Request the availability of a credit card from the user cout << "Are you ready to provide your credit card number(1=Yes/0=No)? "; cin >> Answer; // Since the user is ready, let's process the credit card transaction if(Answer == '1') { cout << "\nNow we will continue processing the transaction."; cout << "\nPlease enter your credit card number without spaces: "; cin >> CreditCardNumber; } cout << "\n"; return 0; }
For this long statement, if you omit the bracket, only the first line is considered belonging to the if statement.
**When studying logical operators, we found out that if a comparison produces a true result, it in fact produces a non zero integral result. When a comparison leads to false, its result is equivalent to 0. You can use this property of logical operations and omit the comparison if or when you expect the result of the comparison to be true, that is, to bear a valid value.
#include <iostream> using namespace std; int main() { int Number; cout << "Enter a non zero number: "; cin >> Number; if(Number) cout << "\nYou entered " << Number << endl; cout << endl; return 0;
}
Otherwise statement
Let's say that you want to make that if A happen then B but if A does not happen, then C.
This is where the usage of else and else if.
The syntax principle is still the same but this statements are treated as a consequence if A did not happen.
if(condition A) statement B;
else if(condition A does not happen) statement C;
If there are only two consequences of A, you can use just else without the else if.
Logical comparison::Note 2
Inequality operators !=
This operators is an operator with the combination of == and ! . The syntax for this operator is:
Value1!=Value2
It is a binary operators that is used to compare two values. Why binary? The reason is because comparison only use 1 and 0.
---
Lesser than operator <
It is to compare if the comparing value is lesser than the compared value. The syntax is:
Value1<Value2
---
Lesser or equal <=
The syntax of this operand is:
Value1<=Value2
---
greater or equal >=
The syntax of this operand is:
Value1 >= Value2
---
Boolean Expression
It is a data type that will set its value to either 1 or 0.
It is declared as the following:
bool IhateU = true.
---

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Logical comparison::Note 1
A comparison is a boolean expression that produces a true or false result.
When a comparison is true, the integral value represented is 1, which is greater than 0. When it is false, the integral value representation is 0.
---
Equality Operator ==
To compare two equal values, C++ uses == operator:
value1 == value2
**Equality sign and assignment sign are not the same.
---
Logical NOT ! operator
When a variable is not used for a certain period of time, it will be rendered useless by the compiler. To make this variable unusable, you can nullify its value. This is where you use:
!Value
!Value is just a wordy representation of 0 and 1. If the value A is an integer, say 143, !value A will be 0. Say that value of the current A is 0, then !value of the A is 1.
Function ::: Note 4
Function global definition
There are times when a function is declared in a 'class' or 'namespace'. At times there are more than one functions or the function definition can be very long that it is advisable not to write a function inside a namespace or the class itself. This is when declaring a function globally can be very useful.
A function is declared normally inside a namespace / class such that::
namespace Ari{
void Rossa ();
}
Ari::Rossa(){
cout << "I'm here" << endl;
}
Even if declared outside, the Rossa function is still inline to Ari namespace.
namespace
What is namespace?
Variable:
Namespace is like a slot where you put additional information of a function, variable etc. It allows you to use the same variable name in different data type which is useful when you ran out of names to give to a variable.
Let's say that you want to use only Rambo as a variable name but you want Rambo to be both int and double.
using namespace, we can design Rambo to be both:
namespace one{
int Rambo = 1;
}
namespace two{
double Rambo = 3.1453
}
To access both Rambo, you must write the namespaceIdentifier::variableName.
int main() {
cout << one::Rambo << endl;
cout<< two::Rambo << endl;
}
Function:
A function can also be a part of a namespace for the exact same reasoning. To declare a function in a namespace, you must do the following:
namespace one{
int Alice;
int MadHatter(){
return Alice;}
}
Technically, you are only required to provide the::
ReturnDataType FunctionName();
The function MadHatter() in the above example has full access to Alice variable so there is no need to pass Alice as an argument.
To gain access of Alice in any other function, eg: main, we use using to access it.
int main(){
using namespace one;
Alice=1;
cout << MadHatter();
return 0;
}
Function ::: Note 3
Constant values
A function receiving a set of variables may alter the information given. If the information in a variable given is known not to be altered, the compiler must be told to keep the value of the variable the same.
The advantage of doing these are the compiler will make sure that the values are not altered and ceases any operation that might alter it and also this speeds up the execution of the program.
To use constant, just add const before the data type in the arguments brackets.
#include <iostream> using namespace std; float Perimeter(const float l,const float w) { double p; p = 2 * (l + w); return p; } int main() { float length, width; cout << "Rectangle dimensions.\n"; cout << "Enter the length: "; cin >> length; cout << "Enter the width: "; cin >> width; cout << "\nThe perimeter of the rectangle is: " << Perimeter(length, width) << "\n\n"; return 0; }
An argument as a constant reference
When passing reference as an arguments, it will access the arguments from its original position. However, sometimes, the value in the referred arguments must not change.
Note:: A function that is declared in a certain function means that the function can only be accessed by that particular function. Say that function A declares function B inside itself. This means that function B can only be accessed by function A.
#include <iostream> using namespace std; // Passing an argument by reference void GetOriginalPrice(double& originalPrice) { cout << "Enter the original price of the item: $"; cin >> originalPrice; } // Passing an argument as a constant reference // Passing arguments by value double CalculateNetPrice(const double& original, double tax, double discount) { discount = original * discount / 100; tax = tax / 100; double netPrice = original - discount + tax; return netPrice; } int main() { double taxRate = 5.50; // = 5.50% const double tiscount = 25; double price; double original; void Receipt(const double& orig, const double& taxation, const double& dis, const double& final); GetOriginalPrice(original); price = CalculateNetPrice(original, taxRate, discount); Receipt(original, taxRate, discount, price); cout << "\n\n"; return 0; } void Receipt(const double& original, const double& tax, const double& discount, const double& finalPrice) { cout << "\nReceipt"; cout << "\nOriginal Price: $" << original; cout << "\nTax Rate: " << tax << "%"; cout << "\nDiscount Rate: " << discount << "%"; cout << "\nFinal Price: $" << finalPrice; }
Function :::Note 2
Function Overloading
C++ allows you to use more than one similar names of functions in the written program. This allowance to have two or more similar names is called function overloading.
To use the function overloading ability, it is important to make sure you do either A situation or B situation. It can be both.
::: A ::: Make sure the data type of each arguments are different
::: B ::: Make sure the number of variables in the arguments are different
Inline functions
The normal process of a function is such as:::
Function A calls Function B and has to go over to Function B to retrieve the result of B's process. Both functions are treated as different functions that are not related.
An inline function is where you treat a function as a part of its calling functions. The compiler do this by copying the code of the function into the calling functions. Say that function A calls function B. Code in function B will be copied and kept in A.
#include <iostream>
using namespace std; inline void Area(float Side) { cout << "The area of the square is " << Side * Side; } int main() { float s; cout << "Enter the side of the square: "; cin >> s; Area(s); return 0; }

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Compiling (The actual process)
Compiling a program works in the following way:
1. Lexical Analysis (lexes)- Conversion process of a set of characters into a sequence of tokens (a string of characters that can initiate certain process according to its classified group such as int for data type and etc for that certain compiler). This is where the compiler will decide whether the characters written brings meaning to it so that useless symbols will not be in the way.
2. Syntatic Analysis (parsing)- Now that it is converted/translated into words(tokens) that is understandable to the compiler, it will now check the grammatical structure of the tokens to see whether it is obeying the grammatical rules of the specific language (allowed or not allowed). At this point, a syntax tree is created.
3. Semantic Parsing - At this point, the compiler adds logical information to its parse tree and build the symbol tree. Here, checks are mostly on whether the type is acceptable in every other corresponding types accepting the value and also the object binding (to see whether any arguments or variables satisfy functions' definitions) or definite assignment (to see whether the variables are initialized or not). Warning of incorrect structure will be issued to the programmer.
Function ::: Note 1
What is a function?
In Calculus will hold a certain variables that performs for a certain value to find its corresponding value. In Programming, a function is given a set of processes that will help the program to produce a certain output.
There are two categories of function: self defined or built in function in operating system.
Function declaration
ReturnType NameOfFunction (declaration of new variables to receive values);
To use a function that have already existed in the compiler, use the header to link with the library. Header here means something like #include <iostream> , #include<cstdio>, #include<vector> etc....
Returning a value
The function that does not return is declared with void. The function that returns a certain value will be declared with the data type of the return value. The function accepting the declare value must have a variable declares ready to accept the value.
In another words:
You have call your neighbour to make item A for you. Let's say that you won't be able to meet with him because you have to fly elsewhere. To give the item to you, you would need to prepare a section ready to accept the item A back and it must be bigger or a perfect fit slot.
Passing arguments
By Value
Just pass a value in the arguments for calling a function:::example::: me(1, 2);
and the accepting function will be declared as void me(int a, int b);
By reference
When you declare a variable in a program, the compiler reserves an amount of space for that variable. If you need to use that variable somewhere in your program, you call it and make use of its value. There are two major issues related to a variable: its value and its location in the memory.
The location of a variable in memory is referred to as its address.
If you supply the argument using its name, the compiler only makes a copy of the argument’s value and gives it to the calling function. Although the calling function receives the argument’s value and can use in any way, it cannot (permanently) alter it. C++ allows a calling function to modify the value of a passed argument if you find it necessary. If you want the calling function to modify the value of a supplied argument and return the modified value, you should pass the argument using its reference.
To pass an argument as a reference, when declaring the function, precede the argument name with an ampersand “&”. You can pass 0, one, or more arguments as reference in the program or pass all arguments as reference. The decision as to which argument(s) should be passed by value or by reference is based on whether or not you want the called function to modify the argument and permanently change its value.
eg: void Area(double &side);
#include <iostream> using namespace std; int main() { float hours, rate, wage; void Earnings(float h, float r); cout << "Enter the total Weekly hours: "; cin >> hours; cout << "Enter the employee's hourly rate: "; cin >> rate; cout << "\nIn the main() function,"; cout << "\n\tWeekly Hours = " << hours; cout << "\n\tSalary = $" << rate; cout << "\n\tWeekly Salary: $" << hours * rate; cout << "\nCalling the Earnings() function"; Earnings(hours, rate); cout << "\n\nAfter calling the Earnings() function, " << "in the main() function,"; cout << "\n\tWeekly Hours = " << hours; cout << "\n\tSalary = " << rate; cout << "\n\tWeekly Salary: " << hours * rate; return 0; }
void Earnings(float &thisWeek, float salary) { thisWeek = 42; cout << "\n\nIn the Earnings() function,"; cout << "\n\tWeekly Hours = " << thisWeek; cout << "\n\tSalary = " << salary; cout << "\n\tWeekly Salary= " << thisWeek * Salary;}
---------
Default arguments
There are times that we want the function to immediately give us a value just by calling the functionName. This is when we want no assignment operators to be involved. The example provided will tell you how this can be done:
#include <iostream> using namespace std; double CalculateNetPrice(double discountRate = 25) { double origPrice; cout << "Please enter the original price: "; cin >> origPrice; return origPrice - (origPrice * discountRate / 100); } int main() { double finalPrice; finalPrice = calculateNetPrice(); cout << "\nFinal Price = " << finalPrice << "\n\n"; return 0; }