update Rpi4 build script, update recursive test: add array of struct in nested struct

This commit is contained in:
QuangNguyenMinh123
2025-11-14 23:45:04 +07:00
parent 15fd277e9d
commit 1678028e39
7 changed files with 122 additions and 21 deletions
+38 -6
View File
@@ -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);
}