【发布时间】:2015-02-21 20:38:20
【问题描述】:
为什么在从 n 格式说明符中获取值时需要使用 & 符号?
例如:
...
int n;
printf("%s: %nFoo\n", "hello", &n);
%n 是 pointer to an integer type
而和号是一个地址,那么为什么在上面的例子中它将格式说明符的结果转换为一个整数呢?
【问题讨论】:
-
我不明白,它应该在我的代码中返回
n=5否? @Wallyk -
@kuhaku no,
n == 7。因为':'和' '。