Archive for C Programming Language
You are browsing the archives of C Programming Language.
You are browsing the archives of C Programming Language.
In a C Program first of all you need to initialize the graphics drivers on the computer. This is done using the initgraph method provided in graphics.h library.
Graphics mode Initialization
initgraph() function is used to load the graphics drivers and initialize the graphics system. For every function, that uses graphics mode, graphics mode must be initialized [...]
A file is a collection of bytes stored on a secondary storage device, which is generally a disk of some kind. The collection of bytes may be interpreted, for example, as characetrs, words, lines, paragraphs and pages from a textual document; fields and records belonging to a database; or pixels from a graphical image. [...]
A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it from the structure. A structure is a convenient way of grouping several pieces of related information together.
Declaring Structures
struct mystruct
{
int numb;
[...]
A pointer is a variable suitable for keeping memory addresses of other variables; the values you assign to a pointer are memory addresses of other variables or other pointers.
C pointers are characterized by their value and data-type. The value is the address of the memory location the pointer points to, the type determines how the [...]
Function is a block of statements which perform some specific task and always return single value to the calling function. Functions are used to minimize the repetition of code.
Some languages distinguish between functions which return variables and those which don’t. C assumes that every function will return a value. If the programmer wants a [...]
Loops are used to repeat one statement or set statements more than one time. Most real programs contain some construct that loops within the program, performing repetitive actions on a stream of data or a region of memory. There are several ways to loop in C.
For Loop
For loop is a counter loop. The for loop [...]
C language possesses such decision making capabilities and supports the following
statements known as control or decision-making statements.
if statement
switch statement
Conditional operator statement
goto statement
if Statement
The if statement is a powerful decision making statement and is used to control
the flow of execution of statements. It is basically a two-way decision statement
and is used in conjunction with an [...]
Arithmetic Operators
As well as the standard arithmetic operators (+ – * /) found in most languages, C provides some more operators. There are some notable differences with other languages, such as Pascal.
Assignment is = i.e. i = 4; ch = `y’;
Increment ++, Decrement — which are more efficient than their long hand [...]