
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.
#include<stdio.h>
struct point {
int x;
int y;
};
void display_point(struct point pt) {
printf("(%d,%d)</p><p>", pt.x, pt.y);
}
main() {
display_point((struct point) {10, 20});
}(10,20)
以上就是在C语言中,复合字面量的详细内容,更多请关注php中文网其它相关文章!
C语言怎么学习?C语言怎么入门?C语言在哪学?C语言怎么学才快?不用担心,这里为大家提供了C语言速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号