Showing posts with label C BASICS. Show all posts
Showing posts with label C BASICS. Show all posts

Saturday, 14 February 2015

DATA TYPE : PRIMITIVE AND NON-PRIMITIVE

Primitive Data Type:

  •  A primitive data type is one that fits the base architecture of the underlying computer such as int, float, and pointer, and all of the variations, there of such as char short long unsigned float double and etc, are primitive data type. 
  • · Primitive data are only single values, they have not special capabilities.
  • · The examples of Primitive data type s are given byte, short, int, long, float, double, char etc. 
  • · The integer reals, logic data character data pointer and reference are primitive data structures data structure that normally are directly operated upon by machine level instructions are known as primitive structure and data type.

Non- Primitive Data type. 

  • · A non-primitive data type is something else such as an array structure or class is known as the non-primitive data type. 
  • · The data type that are derived from primary data types are known as non-primitive data type. 
  • · The non-primitive data types are used to store the group of values. 
  • · Examples of non-primitive data types are Array, structure, union, link list, stacks, queue etc.

Monday, 15 September 2014

Sunday, 7 September 2014

Structure of a C Program

C Program is the collection of one or more function & Every function is the collection of statements & performs some specific task .


Comments

Pre-processor directives
 
Global variables

main(   )   Function
{

local Variables

statements
.................... .
.................... .
}

func1(   )

{
local Variables

statements
.................... .
.................... .
}

We can use function as per our need ,when we write a code for a software , there are lot of function are taken. we talk about function in next posts.

 

Comments

We can place the comments anywhere in the program , these are use for the documentation purpose .
comments are enclosed between delimiters /*

Pre-processor directives

Pre-processor directives are processed through preprocessor  before the c source code passed through compiler.We basically use the #include & #define .

Difference between Compiler & Interpreter .

KNOW WHAT IS THE WORK OF COMPILER & INTERPRETER

  • Compiler & Interpreter .both are the used to convert the code of the high level language into machine language .
  • The high level program is known as source program & the corresponding machine language program is known as object program.

DIFFERENCE BETWEEN THE WORK OF COMPILER & INTERPRETER

  • A compiler searches all the errors of program and lists them.if the program is error free then it converts it into machine code & then the program can be executed by separate commands .
  •  An  Interpreter checks the statement by statement. when it founds that the statement have not any error then it converts it into the machine code ,this process continues until the last statement .