C

struct,typedef小さなメモ

More than 1 year has passed since last update.

コード

test.c
#include "stdio.h"

struct kure{
        int k;
};

typedef struct {
        int k;
} kures;

int main(int argc, char* argv[])
{
        struct kure kure_ = {10};
        printf("%d", kure_.k);

        kures kure1 = {10};
        printf("%d", kure1.k);

        return 0;
}

実行

# gcc test.c
# ./a.out
1010