Thread: c problems
View Single Post
  #2 (permalink)  
Old November 17th, 2005, 10:03 AM
Paramesh Paramesh is offline
Authorized User
 
Join Date: Nov 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Paramesh
Default

Hi Saurabh.
Since C is a procedure oriented language, you should do all the initializations(i.e declarations like int i; etc) before you start to use them.
and you cannot simply pass a variable to the array.
You can pass only constant values.

So, what you can do with this?
You can simply assume a value of a say 50.
Or you should use dynamic memory allocation(that will be difficult since you are a beginner).

So, for the time being, you can do like this:
Code:
int main()
{

int num[50];
...
...
return 0;
}
Note that main must always return an int.
So you should use int main at the start and return 0 in the end.

Please insert your code between the code tags.

:D
Best Regards,
Paramesh.

"Don't walk behind me; I may not lead.
 Don't walk in front of me; I may not follow.
 Just walk beside me and be my friend."
Reply With Quote