XpandNotes

exploring the intersection of technology and creativity

Union and Enumeration

Union A union, like a structure, consists of several members, possibly of different types. The compiler allocates only enough space for the largest of the members, which overlay each other within ...

Structure

Structure Variables Suppose you want to store data of a student, you may store his name, age, height, score… Though an array can store several elements, every element must be the same type! For in...

Array and String

What is an Array An array is a data format that store several value of the same type. For example, an array can store 12 integers indicating day number of every month. Compiler won’t check i...

Variables

Naming Variables C++ encourages user declare meaningful variables. For instance, to express “cost of trip”, the corresponding variable can be named as cost_of_trip or CostOfTrip, instead of cot, x...

C++ Beginning

main() Function 1 2 3 4 5 int main() //function heading { statements return 0; } A function has two parts. One is called function heading. The first word int is call return type, indicati...

Positional Notation

The conversion of positional notation is quite important in computer science since the data are stored as binary signals in disks and memories. We must convert them into decimal so as to make use o...

Two Circles Touch Externally

This post is for solving the intersections of two circles. Suppose the radius of $ C_1 $ is $ r_1 $, and the radius of $ C_2 $ is $ r_2 $. Let $ θ $ be the angel between $ \overline{A C} $ and hor...