如何使用用户定义的变量在 omnet++ 中创建循环。 我尝试了以下但它给了我一个错误: 网络网络{
parameters:
int n @prompt("enter number") = default(2);
connections:
for i=0..n do { // here the n gives me a syntax error (unexpected NAME, expected {
//do things
}
最佳答案
看看 OMNeT++ manual . for
语法没有do
,例如
for i = 0..count-2 {
node[i].port[1] <--> node[i+1].port[0];
}
关于c++ - 如何在 omnet++ 中创建循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33419584/