I have C++ program. there i have used C++ . in order to run that program i'm passing values via unix terminal. But i couldn't run code snippet by passing args values.
- obtain bash build path as
Users/venushka/Library/Developer/Xcode/DerivedData/testFunctions-blcisknaxkrqribioawblwrttsib/Build/Products/Debug
i executed myFunctions bash as
./testFunctionsi pass args as
./testFunctions 1
please find below the code snippet i used
int main(int argc, const char * argv[]) {
// insert code here...
//std::cout << "Hello, World!\n";
if (*argv[0] == 1) {
std::cout << "Hello, World!\n";
//test();
}
return 0;
}
when i gives 1 as arg my programe line hello world hasn't executed. what am i do wrong please help me. thank you . please find the image below