以下c程序的输出是:0.000000输出后面是否有逻辑或者是编译器依赖的答案还是我只是得到垃圾值?
#include<stdio.h>
int main()
{
int x=10;
printf("%f", x);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
PS: - 我知道尝试使用%f打印整数值是愚蠢的.我只是从理论的角度来问这个问题.
在SQL中,表中的单个列可以引用多个表吗?
例如,如果我们有表employee
(PK emp_id, name
) 和customer
(PK cust_id, name
)
我们可以有一张桌子吗contact
(id 参考文献[employee, customer], number
);
或者我们是否需要制作两张表:
contact_cust
(cust_id
参考文献customer, number
)和contact_emp
(emp_id
参考文献employee, number
)
我知道即使第一个选择可行,第二个选择也会更好。我只想知道第一种方法可行吗?
我在网上的某个地方发现了这段代码.程序的输出是字符串字符串字符串有人请解释我为什么第一个secon和第三个printf语句打印相同的输出,即使它们的参数不同?
#include<stdio.h>
int main()
{
char a[2][3][3] = {'s','t','r','i','n','g'};
printf("%s\n", *a);
printf("%s\n", a);
printf("%s\n", **a);
getchar();
return 0;
}
Run Code Online (Sandbox Code Playgroud)