using argv[0] represent binary executable files' name in help() function

in sample codes instead of cpp files' name.
This commit is contained in:
MoonChasing
2020-02-23 21:38:04 +08:00
parent 8b5efc6f4c
commit 98db891851
30 changed files with 218 additions and 207 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ const int SZ = 20; // size of each digit is SZ x SZ
const int CLASS_N = 10;
const char* DIGITS_FN = "digits.png";
static void help()
static void help(char** argv)
{
cout <<
"\n"
@@ -38,7 +38,7 @@ static void help()
" http://www.robots.ox.ac.uk/~vgg/publications/2012/Arandjelovic12/arandjelovic12.pdf\n"
"\n"
"Usage:\n"
" ./digits\n" << endl;
<< argv[0] << endl;
}
static void split2d(const Mat& image, const Size cell_size, vector<Mat>& cells)
@@ -299,9 +299,9 @@ static void shuffle(vector<Mat>& digits, vector<int>& labels)
labels = shuffled_labels;
}
int main()
int main(int /* argc */, char* argv[])
{
help();
help(argv);
vector<Mat> digits;
vector<int> labels;