Array Question

If there are 2 arrays named as test & sample with 20 integer elements in each of these declared as
int test[20],
sample[20],
then which of the following statement is wrong?
a)test=sample
b)sample=test
c)Both a & b
d)none of the above

Questions by Apra Kumar

Showing Answers 1 - 3 of 3 Answers

Manpriya Kaur

  • Aug 14th, 2011
 

Both a & b are wrong,,,,we can't assign arrays directly like this. this thing can only be applied on variables. further,to assign values of one array to another,we need to apply a for loop n assign values under each index separately.

  Was this answer useful?  Yes

Srinivas

  • Aug 15th, 2011
 

Both a and b are wrong.Option c is correct,Because int test[20] contains 20 elements with different address locations that are differ from int sample[20] addresses

  Was this answer useful?  Yes

rizwan

  • Aug 20th, 2011
 

In C# arrays are reference variables , so both a and b are correct

Code
  1.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions