how does a general function , that accepts an array as a
parameter, "knows" the size of the array ?
How should it define it parameters list ?

Answers were Sorted based on User's Feedback



how does a general function , that accepts an array as a parameter, "knows" the size of ..

Answer / ilana

one option :
myfunc (int my_array[], int n ) { ...}

another option:
myfunc (int *my_array, int n ) { ...}

Is This Answer Correct ?    12 Yes 5 No

how does a general function , that accepts an array as a parameter, "knows" the size of ..

Answer / ganesh bankar

its compilers job to identify what is the size the array
depending upon which array is passed to the function.

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More C Interview Questions

what is the use of getch() function in C program.. difference b/w getch() and getche()??

29 Answers   HCL, IBM, Infosys, TCS, Wipro,


Is a house a shell structure?

0 Answers  


Why c is called a mid level programming language?

0 Answers  


What is the real time usage volatile?

2 Answers   Polycom,


without using arithmatic operator solve which number is greater??????????

1 Answers   Accenture,






what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits

2 Answers   Wipro,


What are the features of c languages?

0 Answers  


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

0 Answers   Sikkim Manipal University,


What is structure data type in c?

0 Answers  


program to find the second largest word in a paragraph amongst all words that repeat more thn twice

4 Answers   CTS, iGate,


How can you access memory located at a certain address?

0 Answers  


What standard functions are available to manipulate strings?

0 Answers  


Categories