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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah yes, I've just found time to double check and it is the path of the project not the solution -- thanks phoffric.