+ 1

Suppose we have two arrays of int data type. One is having 40 elements, and other has 25 elements. Can we assign the array of 40

Suppose we have two arrays of int data type. One is having 40 elements, and other has 25 elements. Can we assign the array of 40 elements to an array of 25 elements?

3rd Sep 2020, 3:31 AM
Ali abbas
Ali abbas - avatar
1 Respuesta
+ 9
Yes you can assign: Like this: int a = [40], b = [25]; b = a; Size doesn't matter a and b are just pointer pointing to a memory location. b can point to [40] with no issue.
3rd Sep 2020, 3:34 AM
Aakaanksha 💕 [TheBraveCoders]
Aakaanksha 💕 [TheBraveCoders] - avatar