作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在使用 printf 语句时,我对 C 语言的基础知识有疑问。这就是我的代码的样子。
#include<stdio.h>
int main(){
printf("%s %s",("senthil""kumar"),("hello""world"),("stack""overflow");
return 0;}
我有一个类似的输出,Senthilkumar Hello World
但我不知道这段代码是如何工作的。你能帮我弄清楚它是如何工作的吗...提前致谢。
最佳答案
两个连续的字符串文字由编译器合并。
即以下示例是等效的:
// 1:
"foo" "bar"
// 2:
"foobar"
// 3:
#define FOO "foo"
FOO "bar"
您不需要所有这些内括号(而且末尾缺少 )
)。
关于c - C如何在printf语句中编译 "senthil"“kumar”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27730959/
这个问题已经有答案了: two strings separated by blank being concatenated automatically (3 个回答) 已关闭 8 年前。 在使用 pr
使用以下论文第 4 页上的算法,我正在尝试计算所有对的最短路径矩阵。 http://www.waset.org/journals/ijcms/v3/v3-5-43.pdf 我对(算法的)第 7 行和第
我是一名优秀的程序员,十分优秀!