본문 바로가기 메뉴 바로가기

일상저장소

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

일상저장소

검색하기 폼
  • 분류 전체보기 (20)
    • IZTEN (0)
    • 일상저장소 (4)
    • IZTEN Music (0)
      • 2018 (0)
      • 2014-2017 (0)
      • 2012-2013 [비공개] (0)
      • 단체 (0)
    • 리뷰저장소 (2)
      • 뷰티 (2)
    • C (14)
      • C프로그래밍 (9)
      • C언어 콘서트 (5)
  • 방명록

분류 전체보기 (20)
C언어 콘서트 (개정판) 14장 전처리기와 분할 컴파일 프로그래밍

[3번]//hello.h#pragma oncevoid hello(char *name); //hello.c#include #include "hello.h" void hello(char *name){printf("안녕 %s\n", name);} //main.c#include #include "hello.h" int main(void){hello("철수");return 0;} ====================================== [4번]//array.h#pragma once int get_sum_of_array(int a[], int size);void print_array(int a[], int size); //array.c#include #include "array.h" int get_su..

C/C언어 콘서트 2018. 12. 4. 15:15
C언어 콘서트 (개정판) 13장 동적메모리 Programming

//프로그래밍 1번#include #include typedef struct rec {int i;float PI;char A;} my_record; int main(void){my_record *p = (my_record *)malloc(sizeof(my_record));if (p == NULL) {printf("메모리 할당 오류\n");exit(1);} p->i = 10;p->PI = 3.14;p->A = 'a'; printf("%d\n", p->i);printf("%f\n", p->PI);printf("%c\n", p->A); free(p);return 0;} =============================================================== //프로그래밍 2번#incl..

C/C언어 콘서트 2018. 11. 20. 16:30
C언어 콘서트 (개정판) 12장 프로그래밍

//프로그래밍 3번#include #include int main(void){FILE *f;char ch;int line = 0; f = fopen("line.txt", "r");if (f == NULL) {fprintf(stderr, "텍스트 파일 line.txt를 열 수 없습니다.\n");exit(1);} while ((ch = getc(f)) != EOF) {if (ch == '\n')line++;putchar(ch);}fclose(f);printf("\n라인의 개수=%d\n", line);return 0;} ========================================================================== //프로그래밍 4번#include #include int ..

C/C언어 콘서트 2018. 11. 13. 14:53
18.10.31 파일 입출력 기초

//파일 쓰기_알파벳#include int main(void){FILE *fp = NULL; fp = fopen("sample.txt", "w"); for (char c = 'a'; c

C/C프로그래밍 2018. 10. 31. 17:56
18.10.31 구조체 프로그래밍 응용

// 프로그래밍 6번#include enum game { scissor, rock, paper }; int main(void){enum game computer = scissor;//가위enum game user = scissor;printf("가위(0), 바위(1), 보(2)를 입력하시오: ");scanf("%d", &user); if (user == scissor)//if (computer == user)printf("비겼습니다.\n");else if (user == rock)printf("컴퓨터가 졌습니다.\n");elseprintf("컴퓨터가 이겼습니다.\n"); return 0;} ==============================================================

C/C언어 콘서트 2018. 10. 31. 17:19
18.10.30 구조체 연습문제&프로그래밍 응용

// 연습문제 10번 응용 - Nested Structure 로 두 좌표의 일치여부 검사#include struct point {int x;int y;}; struct equal {struct point p1;struct point p2;}; int equal(struct point p1, struct point p2); int main(void){struct equal p;p.p1.x = 1;p.p1.y = 2;p.p2.x = 1;p.p2.y = 2; printf("일치 여부: %d\n", equal(p.p1, p.p2));} int equal(struct point p1, struct point p2){if (p1.x == p2.x && p1.y == p2.y)return 1;elsereturn 0;..

C/C언어 콘서트 2018. 10. 30. 15:20
18.10.23 구조체

//두개도 가능하다#include #include struct student {int number;char name[10];double grade;}; int main(void){struct student s;struct student m; s.number = 20170001;strcpy(s.name, "홍길동");s.grade = 4.3; m.number = 20170002;strcpy(m.name, "심청");m.grade = 4.0; printf("학번: %d\n", s.number);printf("이름: %s\n", s.name);printf("학점: %f\n", s.grade);printf("학번: %d\n", m.number);printf("이름: %s\n", m.name);printf("학점..

C/C프로그래밍 2018. 10. 23. 15:58
18.10.16 포인터 두번째

// 단어의 개수를 세는 프로그램#include #include #include int main(void){char input[100];int i, count = 0; printf("텍스트를 입력하시오: ");gets_s(input, 99); count = count_word(input);printf("단어의 개수: %d\n", count);return 0;} int count_word(const char *s){int i, wc = 0, waiting = 1;//waiting: 깃발 들고 있음. count가 됨.//file을 쓰고 있다고 flag = 1이라고 알리고, 다른 사람은 flag=0이 될 때까지 기다려야함//DB에 동시에 접속해서 쓸 수 있게끔 만들 수 있음for (i = 0; s[i] != ..

C/C프로그래밍 2018. 10. 19. 12:24
18.10.02 포인터

// 다양한 방법으로 문자열 입력해보기#include int main(void){char str1[6] = "Seoul";char str2[3] = { 'i', 's', '\0' };char str3[] = "the caputal city of Korea.";str1[0] = 's'; //str1의 첫 번째 글자를 바꿔준다.printf("%s %s %s\n", str1, str2, str3); return 0;} ==================================================================== //망한거같은데 1#include int main(void){char str[100];printf("문자열 입력: ");scanf("%s", str); int i = 0;w..

C/C프로그래밍 2018. 10. 2. 16:49
18.09.18 포인터

// Call_by_Value #include void swap(int x, int y){int temp; temp = x;x = y;y = temp;} int main(void){int a = 10, b = 20;printf("swap() 호출전 a = %d, b = %d \n", a, b); swap(a, b);printf("swap() 호출후 a = %d, b = %d \n", a, b);return 0;} // swap() 함수가 실행되지 않는다.// return 값은 1개이므로 값이 넘어올 수가 없다. 2개니까. ==================================================================== // Call_by_Reference #include void..

C/C프로그래밍 2018. 9. 18. 15:40
이전 1 2 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • k라이프트렌드트렌드쇼2018
  • 프리파라썸머페스티벌
  • AIexpoKorea
  • 인공지능박람회
  • 붙이는젤네일
  • C언어
  • 프리파라
  • 2018서울국제도서전
  • 국제인공지능대전
  • 어반디케이
  • k라이프트렌드쇼
  • 2018프리파라썸머페스티벌
  • 프썸페
  • c프로그래밍기초
  • 롱라스팅강자
  • 리뷰
  • 올나이트픽서
  • 젤네일스티커
  • 어반디케이픽서
  • 수업
  • 박람회
  • 예제응용
  • 싱글즈품평단
  • 매직젤스트립
  • 데싱디바
  • 2018-1학기
  • 국민픽서
  • AI박람회
  • 물광아트젤
  • 여름엔국민픽서
more
«   2026/04   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바