C Program - Call by Reference



#include <stdio.h>
#include <conio.h>

void call_by_reference(int *y)
{
    printf("Inside call_by_reference y = %d before adding 10.\n", *y);
    (*y) += 10;
    printf("Inside call_by_reference y = %d after adding 10.\n", *y);
}

int main()
{
    int b=10;

    printf("b = %d before function call_by_reference.\n", b);
    call_by_reference(&b);
    printf("b = %d after function call_by_reference.\n", b);
    getch();

    return 0;
}

Output
-----------

Comments

Popular posts from this blog

Introduction to C++ Programming Language

The Assembly Process Of 8086 Microprocessor-Two Pass Assembling Steps

Installing 8086 Assembler on a Computer