I find it difficult to pass an array as an argument to int main() with default values. For example:
int main(int a){}
works wonderfully. Like
int main(int a = 1){}
Passing an int main() array also works just fine:
int main(int a[3])
However, the combination of these two concepts seems broken:
int main(int a[1] = {0,1})
After a significant amount of googleing, I did not find a solution.
Please help me, SO, you are my only hope!
EDIT
The purpose of this, in short, is to make my code as few lines as possible for the task that my professor recently published (not for glasses - just for training). Purpose - to create a recursive program "12 days of the day"
This is my current program.
#include <iostream>
I would like to pass an array of verses as an argument to main, rather than declaring it over a function. I know this is not the most memorable / stack. But this will eliminate the line :)
c ++ parameters default-value
Michael jasper
source share