View Single Post
  #1  
Old 07-09-2008, 04:31 PM
shmsa's Avatar
shmsa shmsa is offline
Grown up punk

 
Join Date: Oct 2007
Location: Muslim Town Multan
Posts: 195
Contact Number: 0322-6196713
Program / Discipline: BSIT
Class Roll Number: 07-22
shmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the rough
Wink last time we done

It is that code which we have done last time in class


Code:
#include <iostream>
#include <stdio.h>
using namespace std;
inline void func1(int& var1)
{
 
 cout<<"you are inside the inline function"<<endl;
 var1=var1+2;

}
int var3;
int& func2(int& var1)
{
 var3=10;
 cout<<"you are inside the function 2 "<<endl;
 var1=var1+2;
 return var3;
}
int main()
{
 int var1=5;int var2;
 func1(var1);
 cout<<"the new value of var1 is = "<<var1<<endl;
 var2=func2(var1);
 cout<<"the value returned by function 3 is = "<<var2<<endl;
}

Reply With Quote