I get identifer not found error for "startProcess":
int main(int argc, char* argv[])
{
bool result=startProcess(argc, argv);
return 0;
}
bool startProcess(int argc, char* argv[])
{
}
But why?
Functions need to be at least declared before you use them, if not defined. Try putting this at the top of your file.
bool startProcess(int argc, char* argv[]);
The above is a declaration, you're telling the compiler that at some point, you're going to provide a definition for the function, which is this:
bool startProcess(int argc, char* argv[])
{
code here...
}
This difference between a declaration and a definition is important for being able to separate your code into separate files. If you had placed your definition of startProcess in a different file, the compiler would never actually see it while compiling the file that contains main. However, with the declaration, you're making a promise that it exists somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With