본문 바로가기

C Programing

structure

[leechul@~/C_Study]leechul cat 012-structure.c 

#include <stdio.h>


int main(int argc, char argv[])


{

        struct {

                        int a;

                        float b;

                        int c;

        } myst;


        myst.a = 4;

        myst.b = 3.37;

        myst.c = 8;


        printf("a = %d, b=%f, c = %d\n", myst.a, myst.b, myst.c);


        return 0;

}

[leechul@~/C_Study]leechul gcc 012-structure.c -o 012-structure.o

[leechul@~/C_Study]leechul ./012-structure.o 

a = 4, b=3.370000, c = 8

'C Programing' 카테고리의 다른 글

typedef  (0) 2013.12.08
main function arguments  (0) 2013.12.08
function pointer  (0) 2013.12.08
array  (0) 2013.12.08
for-loop  (0) 2013.12.08