mirror of
https://github.com/epasveer/seer.git
synced 2026-08-31 01:20:45 +08:00
update Rpi4 build script, update recursive test: add array of struct in nested struct
This commit is contained in:
@@ -46,15 +46,47 @@
|
||||
*
|
||||
*/
|
||||
int factorial(int n) {
|
||||
struct structTetst testStruct = {-2, "test", {-1, "childTest"}};
|
||||
testStruct.id ++;
|
||||
testStruct.id ++;
|
||||
testStruct.id ++;
|
||||
struct familyStruct family = {
|
||||
// DAD
|
||||
{
|
||||
50,
|
||||
"DAD_NAME",
|
||||
{
|
||||
{1,
|
||||
"1st_child"},
|
||||
{2,
|
||||
"2nd_child"},
|
||||
{3,
|
||||
"3rd_child"},
|
||||
}
|
||||
},
|
||||
4, "FAMILY",
|
||||
|
||||
// MOM
|
||||
{
|
||||
45,
|
||||
"MOM_NAME",
|
||||
{
|
||||
{'a',
|
||||
"a_child"},
|
||||
{'b',
|
||||
"b_child"},
|
||||
{'c',
|
||||
"c_child"},
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
family.numberOfNumber ++;
|
||||
family.numberOfNumber ++;
|
||||
family.numberOfNumber ++;
|
||||
int abc = 0;
|
||||
abc ++;
|
||||
abc *= 2;
|
||||
testStruct.child.childId ++;
|
||||
testStruct.child.childString = "childTest " + std::to_string(abc);
|
||||
family.dad.childArr[0].age ++;
|
||||
family.dad.childArr[1].name = "childTest " + std::to_string(abc);
|
||||
family.mom.childArr[1].age ++;
|
||||
family.mom.childArr[0].name = "childTest " + std::to_string(abc) + std::to_string(abc);
|
||||
if (n <= 1) return 1;
|
||||
return n * factorial(n - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user