Click here to Skip to main content
15,879,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi evryone,

int[] users_NoVhInfo= new int[dynamically];
//dynamically m getting size of array and assigining only some values other value remains zero
for Loop
users_NoVhInfo[i] = Value; // it's only for example.its wrking 

function calling(users_NoVhInfo); /// ERROR.ERROR
void calling(int[] users_NoVhInfo)

in above code m creating array object which is collecting some values..
and it will pass through calling function... but at the tim of calling it is giving ERROR "OBJECT REFERNCE NOT SET TO AN INSTANCE OF AN OBJECT" i can solve this problem...its urgent guys
Updated 16-Jul-10 20:31pm

Assuming the code snippet provided is some mangled psuedo code. Check your for loop is actually doing something along the lines of:

int[] users_NoVhInfo= new int[10];
for(int i=0;i<10;i++)

And you're then calling a function passing in the array, then you shouldn't see that error (due to the array). I would follow what's happening to that array very carefully using the VS debugger.
Share this answer
I don't think this is the right way to define an array of 10 integers:
users_NoVhInfo[i] = {1,2,3,4,.....};

Have a look at array declaration and initialization here:[^]

Rectify your code and then post your experience.
Share this answer
Nish Nishant 16-Jul-10 12:51pm    
Reason for my vote of 5
Worth 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900