c语言结构体应用一

#include <stdio.h>
#include <stdlib.h>


struct abc
{
    char c;
    float v;
};

static void func1(struct abc b)
{
    b.c = 'A';
    b.v = 80.7;
}

static void func2(struct abc*b)
{
    (*b).c = 'C';
    (*b).v = 92.5;
}

int main()
{

    struct abc a = { 'B',98.5};
    func1(a);

    printf("%c,%4.1f
",a.c,a.v);

    func2(&a);
    printf("%c,%4.1f
",a.c,a.v);

    return 0;
}

一勤天下无难事。
原文地址:https://www.cnblogs.com/nowroot/p/15366387.html