top of page

Chapter 11-Functions

 

The best way to develop a C++ program is to divide it into smaller program modules ,which are more manageble than the original program .Modules are written in C++ as classes and functions Afunction is a subprogram which is used to perform a specific task .Afunction is invoked by function call.The function call mentions the function by name and provides information (as arguments) that the called function needs to perform its task.

HEADER FILES

These are components of files of standard library that store various functions i.e their prototypes ,declarations for library that store various functions,data types and constants used with them.

 

 

 

 

 

 

 

 

*isalnum() function is a character function and it checks whether its argument is alphanumeric or not 

*isalpha() function is a charecter function and it checks whether its argument is alphabetic or not 

*isdigit() function is a character function 

and it checks whether its argument is a digit or not .

*islower() checks whether the argument is a lowercase letter or not.

*isupper()checks whether the argument is uppercase or not

*toupper() or to lower()converts its arguments to uppercaseor lowercase

*strcat()concatenates two strings 

*str()cmp compares two strings

*The function getchar(),putchar(),gets(),

puts(),get(),getline(),write (),get() and used

for console input and output.

 

 

 

 

 

 

 

 

Function Pass By Value 

The phrases "passing by value " and "passing by reference " mean the same the same thing in computer terms.Some ttextbooks and C++ programmers say that arguments are passed by value,and some say that they are passed by copy .Both tell one of the two methods by which arguments are passed into receiving functions.

 

 

Funcion Pass By Adress

The phrases "passing by address" and "passing by copy" mean the very same thing. Some textbooks andC++ programmers say that arguments are passed by address and some say that they are passed by reference .When you pass an argument by address ,the variables address is assigned to the receiving function's parameter

 

 

 

 

 

 

Local variables 

The variables  which are declared inside any function are called local variables.local variables declared static retain their value when the function are called local variables.local variables declared static retain their values when the function in which they are declared 

is exited.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Global variables::::::::::

The variables which are declared globally are called global variables global variables are created by placing variable declarations outside any function definition and they retain their values throught the execution of the program

  • w-facebook
  • Twitter Clean
  • w-googleplus
bottom of page