C program to pass pointer as a parameter to a function || Pointers || C Programming
In this, we are going to pass pointer as an argument of a function by using Pointers in C Programming Language.

#include <stdio.h>
void value(int *a) //passing pointers as arguments
{
    *a = 0;
}

int main()
{
    int x = 20;
    printf("Before calling the function x: %d\n", x);
    //function call
    value(&x); 
     //value of x is changed
    printf("After calling the function x: %d\n", x);

    return 0;
}

//..........Coded by Ananya Maurya

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post