C 练习实例95

C语言教程评论

C 练习实例95

题目:简单的结构体应用实例。

程序分析:无。文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili95.html

实例

#include <stdio.h>

struct programming
{
    float constant;
    char *pointer;
};

int main()
{
    struct programming variable;
    char string[] = "公式库网:https://www.gongshiku.com";

    variable.constant = 1.23;
    variable.pointer = string;

    printf("%f\n", variable.constant);
    printf("%s\n", variable.pointer);

    return 0;
}

以上实例运行输出结果为:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili95.html

1.230000
公式库网:https://www.gongshiku.com
文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili95.html文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili95.html
运营不易,
感谢支持!
weinxin
我的微信
我的微信公众号
我的微信公众号扫一扫
weinxin
我的公众号
 最后更新:2021-12-7
公式库网
  • 本文由 公式库网 发表于 2021年12月6日21:34:40
  • 转载请务必保留本文链接:https://www.gongshiku.com/html/202112/c-lianxishili95.html

发表评论