Are the expressions arr and &arr same for an array of integers?



Are the expressions arr and &arr same for an array of integers?..

Answer / Parvendra Singh

No, they are not the same. Arrays are passed to functions by reference, so 'arr' is the base address of the array. On the other hand, '&arr' creates a pointer to the array (a separate variable that stores the address), which can lead to confusion and unnecessary memory usage.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is a undirected graph?

1 Answers  


How does dynamic memory allocation help in managing data?

1 Answers  


Why is bubble sort stable?

1 Answers  


Can hashmap have same key?

1 Answers  


What is the use of hashtable?

1 Answers  


How arraylist increase its size?

1 Answers  


Discuss the difference between a stack and an Array?

1 Answers  


Why hashtable is faster than arraylist?

1 Answers  


What is map keyset?

1 Answers  


Differentiate between comparable and comparator.

1 Answers  


Can we add duplicate keys in a hashmap?

1 Answers  


Does treemap sort on key or value?

1 Answers  


Categories