Saturday, June 8, 2013

C++ programming

Programming in C++ :-

Programming in C++ can be done on Turbo C++,Microsoft Visual Studio IDE very easily they provide built- in editor and menu bar ,program should be saved with .cpp file extension in it like example.cpp.




C++ programmer should know about the data types used in it.
There are 3 types of it:-
1.Built-in data types
2.User defined
3.Derived
1.Built-in type include 3 types they areas follows:-
    I)Integral - i)int
                     ii)char
    II)Floating - i)float
                      ii)double
2.User defined type include 4 types they areas follows:-
    I ) Structure
    II ) Union
    III ) Class
    IV ) Enumeration
3.Derived  type include 3 types they areas follows:-
     I ) Pointer
    II ) Array
    III ) Function

           Each of the fundamental types has a fixed size that determines the range of values that can be stored in them (for integers) or the precision and range of those values (for floating point numbers). A char variable is of the natural size to hold a character on a given machine (typically an 8-bit byte), and the sizes of other types are quoted in multiples of the size of a char. The size of a type is implementation defined (i.e., it can vary among different machines) and can be obtained by the size of operator; for example size of (char) equals 1 and size of (int) is often 4.
          Simple programming in C++ can be done using header files mostly used header file in simple programming is #include<iostream.h> it means that there are built in standard C++ library which has iostream file file in above case where io means the input and output steam in programming <> these are the brackets for header file.It is use to take and display the data from cin>> and cout<< where << and >> are the operators.

Memory management :-

C++ supports four types of memory management:
  1.Static memory allocation. :- 
    A static variable is assigned a value at compile-time, and allocated storage in a fixed location along with the executable code. These are declared with the "static" keyword (in the sense of static storage, not in the sense of declaring a class variable).
  2. Automatic memory allocation. :-
     An automatic variable is simply declared with its class name, and storage is allocated on the stack when the value is assigned. The constructor is called when the declaration is executed, the destructor is called when the variable goes out of scope, and after the destructor the allocated memory is automatically freed.
  3.Dynamic memory allocation.:-
     Storage can be dynamically allocated on the heap using manual memory management - normally calls to new and delete (though old-style C calls such as malloc() and free() are still supported).
  4.Garbage collection :-
    With the use of a library, garbage collection is possible. The Boehm garbage collector is commonly used for this purpose.

The fine control over memory management is similar to C, but in contrast with languages that intend to hide such details from the programmer, such as Java, Perl, PHP, and Ruby.

Operators and operator overloading:-

1. C++ provides more than 35 operators, covering basic arithmetic, bit manipulation, indirection, comparisons, logical operations and others.
2. Almost all operators can be overloaded for user-defined types, with a few notable exceptions such as member access (. and .*) as well as the conditional operator.
3. The rich set of over-loadable operators is central to using user created types in C++ as well and as easily as built in types.
4.The over-loadable operators are also an essential part of many advanced C++ programming techniques, such as smart pointers.
5. Overloading an operator does not change the precedence of calculations involving the operator, nor does it change the number of operands that the operator uses.
6.Overloaded "&&" and "||" operators lose their short-circuit evaluation property.

Features of object-oriented programming :-

  1. Programs are divided into objects and different objects communicate with each through messages,called methods.
  2. Emphasis is given on data rather than procedure.
  3. Data is hidden and can't be accessed or altered by external functions.
  4. Functions operating on data of  an object are encapsulated.
  5. New data and functions can be easily added whenever necessary.
  6. Follows bottom-up approach in program design.
C++ fully supports object-oriented programming,including the four pillars of object-oriented development:-
  I)   Abstraction
  II)  Encapsulation
  III)  Inheritance
  IV) Polymorphism

C++ as Object Oriented Language:
      Object Oriented programming techniques are the best ways,to develop large ,complex software applications and systems.C++ can be used both as an OOPL and simply as a better C.C++ programs are fast and  efficient,which helped to make C++,an extremely popular language.It uses templates,static polymorphism,dynamic polymorphism,generic programming,inheritance;data binding and encapsulation,etc. which covers most of  the object-oriented concepts.
      Also C++ supports a programming technique that allows memory management to be safe and implicit.There are constructors and destructors in C++ programming which has god  role for programming.
The constructors are those which have the same name function as that of class in the a program.

TOKENS
The smallest individual units in a program are known as tokens.C++ has the following tokens:
  • Keywords
  • Identifiers
  • Constants
  • String
  • Operators
A C++ program is written using those tokens,white-spaces,and syntax of the language.






Tuesday, May 21, 2013

Mind Thoughts

Life of boys is to have wife for survive and life of girls is to have knife to make others survive.



Work Hard and you will achieve success definitely.



Together wE can Achieve More is a team.



Be Like Water .



Use your time wisely with wise people.



Never give up, never complain stand and fight with full confidence.



Always keep a smile on your face in all situation, God has given us one life never waste it.



Set a goal in your life.



Always keep a focus in your life.



Follow a diet plan to keep your body healthy.



Give a target to yourself and have competition with yourself. 



Plant trees for your future generation to keep them healthy and wealthy.



Drive safely on roads and follow the rules of traffic to save your life and others life.



Walking is very good for health , so daily walk minimum 5 km.














Monday, May 20, 2013

Programming in computers

Computer Programming


Program is a list of instructions in specific language that is understand by the computer to do the job in a sequence.



To do computer programming you can use any programming languages like C,C++,C#,ASP.NET,JAVA,PHP,Visual Basic,etc. in which you feel you can to strong coding.Each programming language has its own source code and syntax,which you should learn to do it. 
HTML is not a programming language it is a markup language,a markup language is set of mark-up tags.We can use scripting language like vbscript and javascript in HTML.The coding of HTML is basically divided into two section first is head section and second is body section.Scripting language can be written in head or body section.The tags should be closed properly in HTML otherwise error occurs and it is still run on browser.It is case-sensitive if tag is made with capital letter then should be closed with same type. The tags have attributes in it example <body bgcolor=red> </body> here bgcolor is an attribute which changes the background color of web page in red color.To do programming in client side you can use javascript or vbscript for server side script use asp language with HTML.


It is difficult to find error using HTML initially  since there is compilation phase in it .But in other languages like C,C++,ASP.NET,etc. there is compiler which convert's the code in binary first and shows us the error if in syntax or other in programming which saves the time and makes our output without errors.


ASP.NET has made easy to write coding with HTML without errors .In ASP.NET  the tags get closed automatically after pressing enter.The connectivity is also easy using ASP.NET language with database of SQL,OLEDB,MS-ACCESS .SQL is good,strong and with huge database.There is Microsoft Visual Studio 2005,2010,2012 editor for the ASP.NET programming.ASP uses delimiters with coding to embed with HTML there are variant types for language like asp has dim and var for java-script.Variant type uses for all the data type implicitly or explicitly. We can build the solution which shows us the error if occurred after removing the error it shows the build succeeded,after that we can debug our program and view our output.


Operating System plays important role in interface between hardware and user so programming for operating software is very crucial and challenging than application programs.


Programming for software is nowadays surrounded to us which made our work with one click and easy to use.Advanced programming and hacking are the skills of the programmer to handle the software in its way.Technology is increasing day by day so programming has to be always match the lifestyle of today's world.Programming in any language requires library file and  syntax to be known.

 
Program development is a skill it requires logic.Program development is a list of instructions  in specified language to tell the computer to do the job in sequence.Before writing program user has to define problem.Problem is first analyzed.Actually problem solution gets converted into program.But for the conversion there is a process of programming.Programming is a process for development of program ,for a specific problem.
Programming is the software concept where it is the playback of computer job.Computer person should be perfect in programming.The result of any computer job, pike printout,layout,results,data processing; all these works are basically depends upon the programming technique and accuracy of programming.Your program tells your computer to do particular job in a desired manner.

 
If any other query related to computer programming you free to ask ,I will try my best.


Featured posts

Happy Independence Day August 15th

 Here's a message for India's Independence Day (August 15th): "शुभ स्वतंत्रता दिवस! आजादी की 79वीं वर्षगांठ पर, आइए हम अपने देश...

Popular posts