본문 바로가기
Programming/C++

[C] Struct, Inserting, Variables

by OKOK 2017. 3. 28.

/*------------------------------------------------------------------------------------------

@ Pratice C laguage


Author           : SAM

Created          : 28-03-2017

Modified         : 28-03-2017

Language/ver     : C in MSVS2015


Description     : Practice : Struct_Inserting


KEYWORD : Struct, Inserting, Variables

------------------------------------------------------------------------------------------*/


#include <stdio.h>


struct simple {

int data1;

int data2;

};


void show(struct simple ts);


int main() {

struct simple s1 = { 1,2 };

struct simple s2;


s2 = s1;

show(s2);

return 0;

}


void show(struct simple ts) {

printf("data1:%d, dat2:%d\n", ts.data1, ts.data2);

}