File system

Posted On // 1 comment
To store information when the computer is turned off, or to manipulate larger set of bytes, one uses magnetic storage devices. The most common are the hard disks. Informations  are stored under the forms of files, each of them having a name and a size.

A file is very similar to the memory : a set of bytes indexed by their positions.

• Files can be very large, up to hundred times the memory.

• the file access is very slow compared to memory access.

In practice the files are organized on a hard disk with directories (also called folder under Microsoft or Apple Operating systems). A directory can contains files and other directories (we can imagine it as a file containing a list of names of files and directories). This leads to a very powerful hierarchical organization.
»Continue Reading

Signal Quantification

Posted On // Leave a Comment
To encode images or sounds, softwares use quantifications. For example, the standard CD encoding
uses a 44khz sampling of the volume with 16 bits. Similarly, images are represented as map of small squares called pixels, each of them having a uniform color defined by its red, green and blue components. To-
day standard encode each components with one byte, which lead to the famous 24 − bits color encoding.
This is as simple as it sounds: in the computer memory, an image is encoded as a succession of groups of three bytes, each one of those triplets corresponding to the three component red, green and blue of a point on the screen.
»Continue Reading

Data types

Posted On // Leave a Comment
Bytes can represent either integer or floating point numbers, images, sounds, texts, programs, etc. We call type the semantic associated to a group of bytes. For example, a byte alone can carry 256 = 28 different values. Depending on how we consider it, it can represent either an integer value between 0 and 255,
or an integer value between −128 and +127, or a character (in that case we use a table to define the correspondence between the bit configurations and the characters). It could also be considered as two integers between 0 and 15. 

Bytes can be grouped, for example to represent larger integers. The standard integer in C++ on a x86 processor is composed with 4 bytes, thus 32 bits, and can encode a value between −2147483648 and 2147483647. The address of a byte in the memory is itself an integer, and can also be repre-
sented in the memory. Because of the binary representation, the most convenient notation for memory address is in hexadecimal, i.e. base 16. In this base, the digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f}, and each of them represents 4 bits. For example 26 = 16 + 10 will be denoted 1a in hexadecimal.
»Continue Reading

Console I/O Operations

Posted On // Leave a Comment
Console functions perform input from the standard input device and output to the standard output device of a system.

Console word generally refers to the combination of monitor and keyboard computers context. So console I/O functions are also related to the same. Some console function that we are going to learn are getchar(), putchar(), gets(), puts(), which are console I/O  function in C++.

Single Character Function

The Simplest of the console I/O function are getchar(), which reads a character from the keyboard, a putchar() , which prints a character to the screen. Following statements reads a character using getchar() and stores it in variable Ch.

Ch=getchar() ;

The Getchar() waits for the character input until a character is typed at the keyboard. Similarly, putchar() displays the given character on the screen at the current cursor position.

Following statement displays a character (‘b’) on the screen:

Putchar (‘b’);

We can also use putchar() with variables:-

Char ch ;

Ch= getchar() ;

Putchar(ch) ;

String Functions

The functions gets() and puts () are string functions

 The gets() function accepts a string of character entered at the keyboard and places them in the string variable mentioned it.  For ex:-

Char name [21] ;

Gets (name) ;

The above code declares a string namely name which can store 20 valid characters.  The function gets() reads a string of maximum 20 characters and stores it in a memory address pointed to by name. As soon as the carriage return is pressed, a null terminator ‘/0’ is automatically placed at the end of the string.
The function puts() writes a sting on the screen and advances the cursor to the newline.  Any subsequent outputs will apper on the next line of the current output by puts().


»Continue Reading

Concept of Data Types

Posted On // Leave a Comment
Data can be of many types e.g. characters, integers, real, string etc. Anything enclosed in quotes represents characters data types in C++. Numbers without fraction represents integer’s data. Numbers with fractions represent real data and anything enclosed in double quotes represents a string. Since the data to be dealt with are of many types, a programming language must provide ways and facilitate to handle all types of data.


Definition of Data Type
Data Types are means to identify the type of data and associated operation of handling it.






C++ like any other language provides ways and facilitates to handle different types of data by providing data types.



C++ data types are of two types:

Fundamental Types

There are five fundamental data types in C++: Char, int, float, double and void that represent characters, integer, floating-point, double floating point and valueless data representation.

Derived Types

Derived Types construct from the fundamental Types are: Array, functions, pointers, references, constant, classes, structures, unions and enumerations. 
»Continue Reading
'