글
#include <stdio.h>
Point pos2;
|
#include <stdio.h> typedef struct point { int ![]() int ![]() } Point; //Point구조체 선언 Point AddPoint(Point pos1, Point pos2) //구조체 덧셈을 가능하게하는 함수 { Point pos={ ![]() ![]() ![]() ![]() return pos; } Point MinPoint(Point pos1, Point pos2) //구조체 뺄셈을 가능하게하는 함수 { Point pos={pos1.xpos-pos2.xpos, pos1.ypos-pos2.ypos}; return pos; } int main() { Point pos1={ ![]() ![]() Point pos2={ ![]() ![]() Point result; result=AddPoint(pos1, pos2); printf("[%d, %d] \n", result.xpos, result.ypos); result=MinPoint(pos1, pos2); printf("[%d, %d] \n", result.xpos, result.ypos); return 0; } |
#include <stdio.h>
printf("raduis: %g \n\n", cptr->rad); circle c2={2, 4 ,3.9}; ShowCircleInfo(&c1); |
#include <stdio.h>
|
'C언어' 카테고리의 다른 글
20140415 연결리스트 (0) | 2014.04.15 |
---|---|
20140414 atmega구조 (0) | 2014.04.14 |
20140410 구조체 변수와 포인터 (0) | 2014.04.10 |
20140409 구조체 효율높이기 (0) | 2014.04.09 |
20140408 구조체 (0) | 2014.04.08 |
RECENT COMMENT