Original Post
This should be simple, but i can''t figure it... I want to have a optional command line argument passed to my program. I want to check if there are NO arguments and do one thing in that case and if there are arguments I want to make sure that it is "-u" if it is not I want to print a error... here is the code! what I''m I doing wrong? It works for no arguments but if i put -u it still thinks there is an error!
if(argv[1] != '''')
{
if(argv[1] == "-u")
{
//..do one thing
}
else
{
//print error
}
}
else
{
timeData = localtime(&curTime);
}