你想在数组中有值,就像你在评论中所说的吗?或者你想有一个指针数组到MyTestAtvices变量,比如你的数组声明用int类型*让人相信吗?如果你想要这些值,就这样做:如果你想要指针,你可以这样做:但是,我不认为有一个带有变量的MyTestCar变量的列表是非常有效的。考虑用数组替换它们。
以上来自于百度翻译
以下为原文
Do you want to have the values in the array, like you are saying in the comment?
Or do you want to have an array of pointers to the Mytest variables, like your array declaration with type int * makes one believe?
If you want the values, just do it like that:
int CheckMyValue[]={Mytest1.Value, Mytest2.Value, Mytest3.Value };
If you want pointers you can do it like that:
int * CheckMyValue[]={&Mytest1.Value, &Mytest2.Value, &Mytest3.Value };
However, I don't think having a list of Mytest variables with numbers is really efficient. Consider replacing those also with an array.
你想在数组中有值,就像你在评论中所说的吗?或者你想有一个指针数组到MyTestAtvices变量,比如你的数组声明用int类型*让人相信吗?如果你想要这些值,就这样做:如果你想要指针,你可以这样做:但是,我不认为有一个带有变量的MyTestCar变量的列表是非常有效的。考虑用数组替换它们。
以上来自于百度翻译
以下为原文
Do you want to have the values in the array, like you are saying in the comment?
Or do you want to have an array of pointers to the Mytest variables, like your array declaration with type int * makes one believe?
If you want the values, just do it like that:
int CheckMyValue[]={Mytest1.Value, Mytest2.Value, Mytest3.Value };
If you want pointers you can do it like that:
int * CheckMyValue[]={&Mytest1.Value, &Mytest2.Value, &Mytest3.Value };
However, I don't think having a list of Mytest variables with numbers is really efficient. Consider replacing those also with an array.
举报