Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing command line option array to a function? 1

Status
Not open for further replies.

gacaccia

Technical User
May 15, 2002
258
US
hi all,

trying to get up to speed w/ the basics, but could use some guidance. i'm making a console application that accepts command line paramaters. i want to pass the argv to a function and then process the paramaters there. how do i do that? the main function looks like...

Code:
int main(int argc, char* argv[])

how should i declare the function head?
how should i pass argv into it?

thanks,

glenn
 
Code:
void myfunc(int argc, char* argv[]){
	// process
}
int main(int argc, char* argv[]){
	myfunc(argc, argv);

-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top