K

@kimjiyeon

104쪽 22번

C
14 hours ago
#include <stdio.h> /* 이중 포인터 수업 전략 1. 그림 그리기 2. 표 만들기 그림에서 포인터 구조로 옳게 표현된 번호 = 2 표에서 변수의 출력값 = */ int main(){ char str[4][3]={"ab", "cd", "ef",

103쪽 21번

C
15 hours ago
#include <stdio.h> struct atype{ int key; }; void main(){ struct atype a[3][4]={27,43,87,32, 12,51,21,89, 80,40,44,99}, (*p)[4], *q; //*p는 한 행(4칸)짜리 포인터 p=a; q=a[0]; //q =a[0] = 첫

103쪽 20번

C
1 day ago
#include <stdio.h> void print_r(int a[], int n); int main(void){ int a[] = {10,20,30,40,50}; print_r(a, 5); return 0; } void print_r(int a[], int n){ //n=5 int *p = a+1; //*p =a배열 첫번째 칸+1칸 이동!!! =20 while(p>=a)

102쪽 19번

C
1 day ago
#include <stdio.h> //(가),(나) 결과 쓰고, 차이점 설명하시오. //(다)의 출력 결과를 쓰시오. int func1(int x, int y); int func2(int n); void main() { int *b, c, d; int a[5]={1,3,5,7,9}; b=a; printf("%d", *b+3); //(가)

101쪽 17번

C
2 days ago
#include <stdio.h> void func(int *w, int *x, int *y, int *z); void main(){ int data[3]={3,70,700}; int a, sum, *pa, *pb, *pc; a=6; pa=&a; //pa : a의 주소 가리킴 pb=&data[0]; //pb : data[0]의 주소 가리킴 pc=data+1; //pc : data 첫번째 원소

100쪽 16번

C
3 days ago
#include <stdio.h> int mul(int first, int second){ int prod; prod= first * second; return prod; } void main(void){ int i, j, result, *q; int a[6]={2,3,4,5,6,7}; q=a; //q=a의 첫번째 원소 2

99쪽 15번

C
3 days ago
#include <stdio.h> #define SIZE 5 void func(int *, int); int main(void){ int ary[SIZE]={1,7,3,9,5}; //SIZE=5, ary[5] func(ary, SIZE); //func(ary, 5); printf("%d %d", *(ary), ary[SIZE-2]); //ary는 첫 번째 원소 가리킴. *(ary)=5 //ary[3]

98쪽 14번

C
4 days ago
#include <stdio.h> int main(void){ int n1=90, n2=150; int *pin; pin = &n1; (*pin) += 20; pin=&n2; (*pin)-=30; printf("%d\n", *pin); if(n1<n2) printf("%d\n", n1);

97쪽 12번

C
1 week ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

96쪽 11번

C
1 week ago
#include <stdio.h> void main(){ int a[2][3]={{-3,14,5}, {1,-10,8}}; int b[]={a[0], a[1]}; int *p = b[1]; printf("d", b[1]); printf("d", *(--p -2)); printf("%d\n", *(*(a+1)+1)); }

96쪽 10번

C
1 week ago
#include <stdio.h> void main(){ int x[4][3]={1,2,3,4,5,6,7,8,9,10,11,12}; /*x={{1,2,3}, {4,5,6}, {7,8,9}, {10,11,12}} */ int (*p)[3]; //{ , , } 정수 3개짜리 배열을 가리키는 포인터

96쪽 9번

C
1 week ago
#include <stdio.h> void main() { int a[2][3]={{-3, 14, 5}, {1, -10, 8}}; /* {-3, 14, 5}, {1, -10, 8} */ int *b[] = {a[0], a[1]}; int *p = b[1];

95쪽 8번

C
1 week ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

95쪽 7번

C
1 week ago
#include <stdio.h> void main() { int array[] = {100, 200, 300, 400, 500}; int *ptr; ptr = array; printf("%d\n", *(ptr+2)+10); //310 출력 }

6/14 스티브 모고 전공A-9번 균형트리

C
1 week ago
#include <stdio.h> void avlInsert(treePointer *parent, element x, int *unbalanced){ if (!*parent){ *unbalanced = TRUE; *parent = (treePointer)malloc(sizeof(treeNode)); (*parent)->leftChild = (*parent)->rightChild=NULL;

6/14스티브 모고 전공A-2번 포인터

C
1 week ago
#include <stdio.h> #include <stdlib.h> int g(int* p){ *p=p[1]+20; p++; int ans = *p; p[0]=456; return ans; } int f(int* q, int** p) {

6/14 전공B-9 연결리스트 역순+재귀

C
1 week ago
#include <stdio.h> #include <stdlib.h> struct node { //연결릿트 노드 int x; struct node* next; }; struct node* node_alloc(int x, struct node* next){ //노드 생성 함수 struct node*temp=(struct node*)malloc(sizeof(struct node)); temp->x=x; //데이터

95쪽 6번

C
1 week ago
#include <stdio.h> void main() { int nums[5]={11,22,33,44,55}; int *ptr=nums+1; //ptr이 가리키는 부분 : {22} int i; for(i=0; i<4; i++) //i=0~3까지 printf("%d ", *ptr++); // {22,33,44,55} return 0; }

94쪽 5번

C
1 week ago
#include <stdio.h> int main() { int a[] = {1,2,4,8}; int *p=a; p[1]=3; //a[]={1,3,4,8} a[1]=4; //a[]={1,4,4,8} p[2]=5; //a[]={1,4,5,8} printf("%d, %d\n", a[1]+p[1], a[2]+p[2]); //a[1]+p[1]=4+4=8

94쪽 4번

C
1 week ago
#include <stdio.h> // 32bit 컴퓨터 // int = 4byte // 배열의 시작 주소 7094 int main(int argc, char *argv[]) { int *a; int b[5] = {2, 4, 7}; //{2, 4, 7, 0, 0} a = &b[0]; printf("%d, %d, %d \n", *a+3, *(a+3), a+3); //*a+3 = 2+3 = 5