about the function parameters

A

apporc

A:
int main(argc,argv)
int argc;
char* argv[];
{...}

B:
int main(int argc,char* argv[])
{....}

Is there something different between A and B?
Thanks.
 
S

Seebs

A:
int main(argc,argv)
int argc;
char* argv[];
{...}
B:
int main(int argc,char* argv[])
{....}
Is there something different between A and B?

Yes, the second is a function prototype. For these *particular* types,
they happen to have roughly the same effect, but for some other types
(e.g., float), they wouldn't.

Use the second form.

-s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top