首页 > 解决方案 > 可以在 C 中的函数调用的参数之间放置注释吗?

问题描述

我必须从主函数调用一个函数,例如:

void main()
...
...
...
printf("Starting function- saveSubscriber");
  status = saveSubscriber(io_ctr,
                   i_pRec,
                   /*&ufpEsn,*/     **/* Change #6*/**
                   iov_pmktbuf,
                   &i_pCntRec,       **/* Change #23 */**
                   iv_pActvBuf->pr ); 

...
...
}

将注释放在参数旁边(/* Change #6*//* Change #23*/)好吗?也就是说,代码是否会编译并且它的功能是否与没有注释时相同。

标签: c

解决方案


The comment syntax is fine.

For me commenting arguments is a sign, that the name of the argument is not chosen clearly.

Moreover, commenting out a complete agrument leaves me a bit puzzled. It seams like somebody changed the signature of the function and was too lazy to clean it up properly.


推荐阅读