Object Oriented Concepts and Programming

Blog is for Object oriented concepts and prgramming. Specially for MCA GTU (Gujarat Technological University) student

RSS
  • Home
  • Edit

Google Android

Monday, November 1, 2010 by Vishal Joshipura | 0 comments
Hi,

     Lets take some look at the google android and fundamental, where you can develop your carrier with mobile technology.
http://vishaljoshipura.blogspot.com/2010/11/some-look-at-google-phone-google-andoid.html


System Software: Assignment - 2 Data Structure for Language Processing

Thursday, August 26, 2010 by vaibhav | 0 comments
System Software: Assignment - 2 Data Structure for Language Processing


my personal blog

Wednesday, August 4, 2010 by vaibhav | 0 comments
hi,
my personal blog is www.vagandhi.blogsopt.com where you will get information about current trends in Information Technology, How to prepare for job interview, What companies are expecting from students, etc.. along with technical articals


My blog for system software

by vaibhav | 1 comments
Hi all,
Plz refer my blog www.systemsoftware-mca3.blogspot.com for updates of system software


What actually passing by address means internally, pass by address is passing as value

Saturday, May 22, 2010 by Vishal Joshipura | 0 comments
When you pass an address to a function, that address is actually passed by value!
Because the address is passed by value, if you change the value of that address
within the function, you are actually changing a temporary copy. Consequently,
the original pointer address will not be changed!

Example:

#include "iostream"
#include "conio.h"
using namespace std;

void fun_test(int *);
int main()
{
    int value=50;  
    int *ptr = &value;      // Which means *ptr = 50
   cout <<<"Value Before : "<< *ptr;      // This will print 50
    fun_test(ptr);
    cout <<<"Value after : "<< *ptr;         // This will print 50
    getch();
    return 0;
}

void fun_test(int *arg_ptr)
{
    int fun_value=10;
    arg_ptr = &fun_value;    // This will print 10
    cout <<<"Value in function : "<< *arg_ptr;
}


Question :
         We are pass argument by address and if it is pass as value
         then why the change in its value is affected at the original
         calling place?

Answer   :
         When you change the value at the address
         then it will affect to the original memory address's
         content so its effect will still remains at the place
         from where the function calls and argument's
         address will be change by function statement.

Argument, Pass by address, Pass By argument

OOCP Material

Wednesday, May 5, 2010 by Dr. Parag Shukla | 0 comments


Download

OOCP Material

Program code for calculating Factorial of a no, How Recursive function will call and showing process of recursion.

Wednesday, April 21, 2010 by Vishal Joshipura | 0 comments
/*
  The Program for calculating factorial of a no.
  Here, Fact is a recursive function
  It will calculate factorial as below

 if user input is 4
 fact(4)        // call from main m=4,n=4;
 fact(4-1)*4 will call function it self as recursion
      fact(3)   m=3   
      fact(3-1)*3
          fact(2)
          fact(2-1)*2
               fact(1)    // it will return 1 to last cll of fact
          (1 * 2)      // 1 comes from upper call's return value
      ((1*2) *3) = (2*3)  //  2 comes from very upper call's return value
( (1*2*3) * 4) 
(6*4)=24                        // 6 comes from upper last call of fact's return values
and at last 24 will return to main


The program code for showing the recursion mechanism of function.
It will maintain stack call internally for manipulating function calls and
values at diffrent call.
*/
#include "iostream"
#include "conio.h"
using namespace std;

int fact(int m)
{
    if(m==1)
        return 1;
    return fact(m-1)*m;
}

int main(void)
{
    int no=5;
    cout<<"Enter No to calculate factorial of it : ";
    cin>>no;
    cout<<"factorial of "<< no <<" is  "<< fact(no);
    getch();
    return 0;
}

Fact, Factorial, Recursive Function

Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2010 (10)
    • ▼  November (1)
      • Google Android
    • ►  August (3)
    • ►  May (2)
    • ►  April (3)
    • ►  March (1)

Followers

Labels

  • Argument (1)
  • Class (1)
  • Defualt Argument (1)
  • Fact (1)
  • Factorial (1)
  • Item (1)
  • OOCP Material (1)
  • Pass by address (1)
  • Pass By argument (1)
  • Recursive Function (1)

Contributors

  • Dr. Parag Shukla
  • Vishal Joshipura
  • vaibhav

Pages

  • Home
Copyright © 2010 Object Oriented Concepts and Programming