This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Wednesday 27 February 2013

What Is Micro Substitution

The #define directive is the most common processor directive, which tell the Processor to replace every occurrence of a particular character string ( that is, a macro name ) with a specified value ( that is, macro body).

The syntax for the #define directive is:

 #define Macro_name macro_body


Here macro name is an identifier that can contain letters, numerals, or underscores. Macro_body may be a string  or a data item, which is used to substitute each macro_name found in the program. As mentioned earlier, the operation to replace occurrences of the macro_ name with the value specified by the macro_ body is known as macro substitution or macro expansion. The value in the macro body specified by a #define directive can be any.character string or number.

Example: #define NAME  "to more"

Here NAME will be replaced by "to more." .

Other examples:

#define MUX  (8*8)

On the other hand, we can use #undef directive to remove the definition of a macro name who has been previously defined.

Syntax:

 #undef macro_name

Here macro_name is an identifier that has been previously defined by a #define directive.The #undef directive "undefined" a macro name.For instance the following segment of code.



#define NAME "author"

printf(" I am of %s.\n ",NAME);
  
#undef NAME 

It defines the macro name NAME first, and uses the macro name for the print( function  then it removes the macro name.

Defining the macro with arguments:
You can specify one or more arguments to a macro name defined by the #define directive, so that the macro name can be treated like a simple function that accepts arguments.

 #define MUL(val1,val2) ((val1)*(val2))

When the following statement.

 A result= MUL(2,3)+10;

The  preprocessor substitute the expression 2 for val1 and 3 for val2  and the produces the following statement.

 result=((2)*(3))+10;

/*Program to understand macros with arguments*/




#include <studio.h>
#define SUM(x,y) ((x)+(y))
#define PROD(x,y) ((x)+(y))
main()
{

     int l,m,i,j,a=5,b=3;
     float p,q;
     l=SUM(4,6)
     m=PROD(a,b)
     i=SUM(4,6)
     j=PROD(4,6)
     p=SUM(2.2,3.4);
    q=PROD(2.2,3.4);
    printf("i=%d,m=%d,i=%d,j=%d,p=%0.1f,q=%0.1f\n",I,m,I,j,p,q); 

}


Output :



l=8,m=15,i=10,j=24,p=5.6,q=7.5

What Is C Processor?

If there is a constant appearing in several places in your program.it's a good idea to associate a symbolic name for the constant, and then use the symbolic name to replace the constant throughout the program. There are two advantages in doing so. First, the program will be more readable. Second, Easier to maintain.

program.  For instance, the value of the constant needs to be changed, Find the statement that associates the constant with the symbolic name and replaces the constant with the new one. Without using the symbolic name, you have to look everywhere in your program to replace the Constant.

C has a special program called to C processor who allows the programmer to define and associate symbolic names with constant. In fact, the C Processor uses the Terminology macro names and macro body to refer to the symbolic names and the constant. The C Coprocessor runs before the compiler. During Prepossessing, the operation to replace a macro name with its associated macro body is called macro substitution or macro expansion.

 In addition, the C Processor gives you the ability to include other source files. For instance, We've been using the preprocessor directive #include to include C header files. such as studio.h ,studio.h and string.h in the Programs  also, the C Preprocessor enables to compile different sections of the program under specified conditions.

                                                                  (OR)

 Preprocessor is a Programe which executed automatically before passing source program to the compiler Processioning is under control of Processor directives.



Preprocessor directives are classified into four types :

1. Micro Substitution Directives
    Example  #define.

2. File Inclution Directives
    Example  #include

3. Conditional Directives
     Example #if, #else, #else if, #end if, #ifdef, # ifindef, #undef

 4. Misslenious  Directives
     Example #error, #line, #progma



Friday 22 February 2013

What Is C Plus Plus

C++ is an object oriental programing language (oop's)

OOPs are mainly the collection of eight principles. If any programing language supported all the oops principle except Inheritance and polymorphism known as oxide based programing language.

Example: 

java script, Vb-script, small talk, talk, etc.

If any programing language supported all the oops principle known as oxide oriental programing language.
Example: C++, Java, Net, php, etc.

C++ is not completely an oxide oriented programing language because C++ can  be developed   by using oops concept or without using the oops concept. So that it is known as Semi-structure programing language or partial oxide  oriental programing language  C++ is also known as the compiler based programing language.


Compiler is a special programing, which will convert high level language into the low-level language(or) source code into object code the process of convention is known as compilation .C++ is very rich in its predefined function, predefined class and predefined.

What Is Embedded System?

embedded
Embedded System is combination of software and hardware and Designed to Perform Specific task.

In general embedded system is not an exactly define term,as many systems have some element of Programmability. For example handheld
computers share some elements with embedded sytem-Such as the operating systems and microprocessors which power them-but are not truly embedded system because they allow different application to be loaded and peripherals to be connected.
An embedded system is a specific-purpose computer system designed to perform one or a few dedicated function, sometimes with real-time computing constraints.It is usually embedded as part of a complete device including hardware and mechanical parts.In contrast a general-purpose computer such as a personal computer can do  many tasks depending on programing Embedded system have become very important today as they control many of the common devices we use.


Since the Embedded system is dedicated to specific tasks,design engineers can optimize it ,reducing the size and cost of the product,or increasing the reliability and performance.Some embedded system are mass-produced,benefiting from economies of scale.

Physically,Embedded system range from portable devices such as digital watches and mp3 players ,to large stationary installations like traffic lights, factory controllers,or the system controlling nuclear power plants complexity varies from low,with a single networks mounted inside a large chassis or enclosure.

Certain operating system or language platforms are tailored for the Embedded market,such as Embedded Java and windows XP embedded. However some low-end consumer products use very.

Operating system both part of a single program,with the application and operating system both part of a single program. The program is written permanently into the system memory in this case ,rather than being loaded into RAM as programs on a personal computer.

Twitter Delicious Facebook Digg Stumbleupon Favorites More