Rules of function, C/C++ Programming

Rules of function:

  • Inline function created without prototype it reduces the memory and it is used only for small function. Inline function cannot have recursion, static variable ,goto and switch .
  • Default argument should be specified in the prototype.
  • Function defined below the main program should have a prototype or declaration before calling the function. Where as function declared above require not have prototype.
  • When a function with default argument is known without the argument then that argument gets the default value.
  • Constant argument can also have default value. Default value cannot be modified only inside the function; but any value can be passed to constant argument.
  • Functions without argument and with only one argument as default argument will guide to uncertainty (unclear) for the compiler; therefore the programmer should avoid such type of function declaration.

Class  is  a  fresh  concept  introduced  in  C++.    It  is  the  core  of  objected  oriented programming.                          

Class  is  advanced  extension  of  structure  in  C  language.   The  members  in structure are array and primary data type.  The members can be accessed globally or it can be said they are public members.  Structure serve only limited.  It is primarily used to group a collection of data  and  define  it as a structure. Other than  that  there  is special advantage  of defining  a structure. To overcome these boundaries C++ has introduced a new type of concept called Class.

A class is defined as structure with using key word class.  A class can have primary data types  and  functions  as  its  members. These  members  can be hidden  by making  as  private members.   When the members are not defined public as or private the members take default property as private members.   To make the members public, the word public should be defined inside the class.

Posted Date: 9/20/2012 7:50:38 AM | Location : United States







Related Discussions:- Rules of function, Assignment Help, Ask Question on Rules of function, Get Answer, Expert's Help, Rules of function Discussions

Write discussion on Rules of function
Your posts are moderated
Related Questions
C Program for FIND EVEN & ODD NO.S IN THE ARRAY #include stdio.h> #include string.h> #include conio.h> void main() {           int i=0,j=0, l_e[100],l_o[100];

I want a Reverse engineer a .exe to obtain the code Project Description: I'd like to get the full C++ source code from a .exe please Skills required is C++ Programming

Question 1) What are the commonly used input/output functions in C? Question 2) What is the difference between function declaration and function definition? Write a recursive

Rules of Inheritance: Private members are not inherited; the members can be accessed only within its class. It cannot be used through the object. Protected members are

A: Use p = new T[n] and delete[] p:   Fred* p = new Fred[100]; ... delete[] p; Any time you allocate an array of objects through new (generally with the [n] in the n


Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Explain the Command Line Parameters? The Command line arguments are parameters supplied to a program from the operating system. These arguments are parameters accepted to main

A virtual function permits derived classes to replace the implementation given by the base class. The compiler makes sure the replacement is always known as whenever the object in

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano