【发布时间】:2014-02-25 07:33:38
【问题描述】:
我不明白这个printf() 电话是如何将两个数字相加的。 %*c 跟这个有关系吗?
//function that returns the value of adding two number
int add(int x, int y)
{
NSLog(@"%*c",x, '\r');
NSLog(@"%*c",y, '\r');
return printf("%*c%*c", x, '\r', y, '\r'); // need to know detail view how its working
}
用于通话
printf("Sum = %d", add(3, 4));
输出
Sum=7
【问题讨论】:
-
它在 openCL 中不起作用,因为 printf 返回 0 或 1...
标签: c printf format-specifiers