Arrays

Q1:
Which of the following is correct way to define the function fun() in the below program?
#include<stdio.h>

int main()
{
    int a[3][4];
    fun(a);
    return 0;
}

A
void fun(int p[][4])
{
}

B
void fun(int *p[4])
{
}

C
void fun(int *p[][4])
{
}

D
void fun(int *p[3][4])
{
}

ANS:A -

void fun(int p[][4])
{
}

void fun(int p[][4]){ } is the correct way to write the function fun(). while the others are considered only the function fun() is called by using call by reference.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.