Am writing a program to find the binary directory of any executable, so I use FindExecutable() but sometimes it does not find the executable and i want the program to know that the Executable has not been found but i don't know how, please help.
#include <windows.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
if (argc == 2) //Try to see if the user Entered a command
{
char rgvalue[100];
FindExecutable(argv[1], NULL, rgvalue);
printf("%s", rgvalue);
}
return 0;
}
<< moderator edit: added [code][/code] tags >>