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.
我遇到一个代码:( printf("\tout:\t%-14.14s\n", (sprintf(tmpbuf[0], "[%s]", mystring), tmpbuf[0])); )中的那些句子与 sprintf 是什么意思?
printf("\tout:\t%-14.14s\n", (sprintf(tmpbuf[0], "[%s]", mystring), tmpbuf[0]));
它是一个涉及逗号运算符的表达式,将以下内容放在一行中:
sprintf(tmpbuf[0], "[%s]", mystring); printf("\tout:\t%-14.14s\n", tmpbuf[0]);
逗号运算符计算两个参数并返回其正确的参数,即tmpbuf[0].
tmpbuf[0]