• Advertisement

Archived

This topic is now archived and is closed to further replies.

Executing from command line

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can i make a program to be able to be executed from a command line forexample: pack p5.txt pack is the name of the program p5.txt is the filei needto compact

Share this post


Link to post
Share on other sites
Advertisement
int main(int argc, char ** argv);

argc is the number of arguments, 1(the executable''s path) if none are specified

argv are the arguments, argv[1] is the one you want in this case. argv[0] contains the executable''s path.

If you are using WinMain... well, I''m tired

Share this post


Link to post
Share on other sites
But how do i get the string of the filname that the user puts infrot of the name of the executable name??

Share this post


Link to post
Share on other sites

  • Advertisement