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
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 |
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 |
Why static is used in c?
being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
Between macros and functions,which is better to use and why?
Why does this code crash?
How can this be legal c?
Finding first/last occurrence of a character in a string without using strchr( ) /strrchr( ) function.
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words )
What is array of pointers to string?
the data type used for unlimited value in c and how to do this program
What are the characteristics of arrays in c?
Why preprocessor should come before source code?