본문 바로가기
Programming/C++

[C] Struct storing name and number at the same time

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 : TelPhone1.c


Showing sturct can including array also.

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


#include <stdio.h>

#include <string.h>


struct person {

char name[20];

char phone[20];

};


int main(void) {

struct person p = {"Free Sam", "02-123-123" };

printf("name : %s , phone : %s \n", p.name, p.phone);

return 0;

}