Friday, 13 September 2013

How to catch argv null exception?

How to catch argv null exception?

In my program I pass an argument from console and save it to a variable.
Let's say
const string FileName= argv[1];
If there is no argument passing I get this
terminate called throwing an exception
How can I catch an exception and show proper error to user that there is
no arguments passed?

No comments:

Post a Comment