일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 이웃한 칸
- 코스닥
- 백준
- frontend
- java정리
- Project
- 자바독학
- 개인프로젝트
- Reflex
- 프로그래밍
- backend
- 코딩
- 개발자
- 사물인터넷
- 개발
- SNS
- 프로그램
- 풀스택프레임워크
- 코딩테스트
- 자바정리
- Python
- 코딩독학
- 모의 주식
- 코테
- java
- 빅데이터
- C++
- 주가예측
- 자바
- 프로그래머스
- Today
- Total
목록C Programming (104)
Creative Code
※main.c파일 #include #include "serial.h" int main(void) { for (int i = 1; i
※main.c 파일 #include #include // user의 헤더파일을 가져올 때 #include "rand.h" // 같은 디렉토리 안에 있는 헤더파일을 가져올 때 int main(void) { my_srand(time(NULL)); for (int i = 1; i my_stand함수와 my_rand함수만 접근이 가능하다. // -> 허용된 연산을 통해서만 데이터에 접근하게 할 때 사용(직접적으로 접근x) void my_srand(int s) // function definition { seed = s; } int my_rand(void) { seed = 1103515245 * seed +12345; return ((unsigned)(seed/65536)%32768); }
#include #include void my_srand(int); // function declaration 함수 선언(미리 선언을 해두면 main 함수 밑에 함수를 쓰거나 다른.c파일에 분리를 하더라도 참조할 수 있다. int my_rand(void); int main(void) { my_srand(time(NULL)); for (int i = 1; i
#include #include int seed; void my_srand(int s) { seed = s; } int my_rand(void) { seed = 1103515245 * seed +12345; return ((unsigned)(seed/65536)%32768); } int main(void) { my_srand(time(NULL)); for (int i = 1; i
#include int a,b; // global var(전역변수) -> 모든 함수들이 접근 할 수 있는 변수 void swap(void) { int tmp = a; // local var(지역변수) a = b; b = tmp; } int main(void) { a = 100; b = 200; printf("a : %d\tb:%d\n",a,b); swap(); printf("a :%d\tb :%d\n",a,b); return 0; }
#include #define _CRT_SECURE_NO_WARNINGS int main(void) { int board[11][4] = { 0 }; // 각 프레임에서 친 점수를 기록한 배열 int index = 0; // board1배열의 인덱스 int total = 0; // 총 점수 for (int i = 1; i = 2 && j == 2 && board[i - 1][1] == 10) { // (10점),(a,b)점인 경우 total += 10 + board[i][1] + board[i][2]; printf("%d 프레임의 총 점수는 %d 입니다.\n", i - 1, total); } else if (j == 3 && board[10][1] == 10) { // 10프레임 1번째 투구가 10점인 ..