what is the difference between : func (int list[], ...) or
func (int *list , ....) - what is the difference if list is an array and if also if list is a pointer

Answers were Sorted based on User's Feedback



what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the ..

Answer / vimal

Nothing,because ultimately pointer to the first element of
array is send to the function,therefore using both method
changes made in called function will affect the calling
function. In one first you indirectly reference the pointer
and in other you directly reference the pointer.

Is This Answer Correct ?    2 Yes 0 No

what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the ..

Answer / guest

in func(int list[]: it gives only the address of the value
which was stored in the list.
func (int *list , ....):it gives the value which is stored
in the list

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

Is python a c language?

0 Answers  


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

0 Answers   Wilco,


how to find a 5th bit is set in c program

4 Answers   IBM,


Explain why can’t constant values be used to define an array’s initial size?

0 Answers  


What is header file definition?

0 Answers  


ASCII stands for

1 Answers  


write a program whose output will be- 1 12 123 1234

10 Answers  


How to reverse a string using a recursive function, with swapping?

5 Answers  


Explain the difference between ++u and u++?

0 Answers  


What is a function simple definition?

0 Answers  


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

0 Answers  


how to print 2-D array using a single for loop?

2 Answers   Mind Tree, TCS, Value Labs,


Categories