Can we assign it or not or if we can assign it then how ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we assign it or not or if we can assign it then how ?

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, 2:49 AM
Ali abbas
Ali abbas - avatar
1 Answer
+ 12
If these two are static arrays then you can create another array of size 40+25 (size of both arrays) and assign the two array's elements through looping. If you are using dynamic arrays then you can resize the first array and assign second array's elements to the array.
3rd Sep 2020, 2:55 PM
Nova
Nova - avatar