Link to home
Start Free TrialLog in
Avatar of panJames
panJames

asked on

Arguments for main function

Hello experts!

Please, have a look at this example:

int main( int argc, char** argv )
{
  if( argc != 2 || !(g_image = cvLoadImage(argv[1])) )  
    return -1;

}

I am using VC++ Express.

Questions:

How can I pass the name of the file to this function in the run time?

I tried:
Config Properties -> Debugging -> Command Arguments -> "bitmap.bmp"

bitmap.bmp is in the same directory as my exe.

Still, program does not find it in a run time and does not find it when run as exe.

Any help?

Thank you

panJames
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>  the folder where your project (not necessarily the workspace .sln) resides

Ah yes, I've just found time to double check and it is the path of the project not the solution -- thanks phoffric.