Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
struct Car { string model; boolean reserved; }; interface gestion{ Car consult(in string model); };
我想让该consult方法返回一个数组Cars,我是否需要创建另一个结构并将汽车数组放入其中?
consult
Cars
您可以在 IDL 中定义数组如下
typedef Car CarArray[5];
但是,这是一个固定大小的数组。如果要创建可变大小的数组,最好使用类似的序列
typedef sequence <Car> CarSequence;
而不是将咨询方法更改为
CarArray consult(in string model);
或者
CarSequence consult(in string model);