卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章19163本站已运行343

在C语言中,复合字面量

在C语言中,复合字面量

In this section we will see what is the compound literals in C. The compound literals are introduced in C99 standard in C. Using this feature, it can create unnamed objects. In the following example we will see how to use compound literal to generate object without any name.

Example

'
#include<stdio.h>
struct point {
   int x;
   int y;
};
void display_point(struct point pt) {
   printf("(%d,%d)<p>", pt.x, pt.y);
}
main() {
   display_point((struct point) {10, 20});
}</p>

输出

'
(10,20)
卓越飞翔博客
上一篇: 如何开发PHP CRM系统中的合同管理功能
下一篇: 返回列表
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏