가 내는 단 C 문.
C 기를 *대로* 배다면 문가 될 것다.
** : 말고 그냥 보기 바란다.
※ 다 가고 다면 다고 고, 면 다고 고 그런 를 .
1.
-
다.
-
다. 메 가 못되다. -yahar
다. -민
C 러 따라 메는 렇게 가 ;;; 러는 return int 라고 warnning 내기 ;; -
2.
-
다. 린는 %f 가 %d로 바뀌면 더 게 력될꺼같다.-민
signed int a b를 더면 (65535/2) 데가 게 되 -가 나다. (-65536/2)+((30000+30000)-(65536/2-1)) <- 제대로 설명을 못하겠다;;; -
-
3.
-
다. 릭 는 그러까 &a 값만 변 는같다(닌가;;)-민
다. 문 b=a; 다. const char * char * 대 다. 러 러. -
-
4.
-
다. f가 고 s다. -민
다. atof로 float변 되만, atof 로 는 더를 가 기 때문 int로 return된다. , num 123 담긴다. ANSI C99는 로 되 면 되 록 변다. -
-
5.
-
다. 0 가는 부 린 되는같다. -민
다. 0 면 8로 급된다. 0x <- 16진수 -
-
6.
-
다. ss[] "문"란 단는 isdigit로 다. (드므로.) 것 isdigit로 려면 unsigned char로 면 된다. 기본 char signed다. -
-
7.
-
다. 문 문는 가 돼 는같다. -민
다. , 교문 라 로 리다. -
-
8.
-
다. 단 만 다. -민
다. 만 다. -
-
9.
-
다. -민
다. NUM 가 2 define 되다. 경 나 define된 200로 리된다. -
-
10.
-
다. -민
다. static C++ private 다. 나 로만 다는 것 다. -
-
11.
-
다. -민
다. 로 되 기 때문 return int로 바뀐다. 로 return 러 기 는 것다. -
-
12.
-
-
100 까만 내겠다.
11 까 답 .
C 기를 *대로* 배다면 문가 될 것다.
** : 말고 그냥 보기 바란다.
~cpp Spec 다과 같다. 16Bit Windows ANSI C를 규격로 는 Compiler (C90)
~cpp
#include <stdio.h>
main(){
int i;
for(i=0; i<10; i++){ // 딴 : {는 for문 뒤 는 것 다. -_-. 내리는 것 말 다.(가독 다.)
printf("%d", i);
}
}
Note:
-
다.
-
러 로그래밍 다. C90라는 까. 구 로그래밍 다고 더라, 로그램 따라 로그래밍 는게 다.
, 그렇 다. -yuhar
-
, 그렇 다. -yuhar
~cpp
#include <stdio.h>
main(){
int a, b;
double c;
a = 30000;
b = 30000;
c = a + b;
printf("%f", c);
}
Note:
-
다. 린는 %f 가 %d로 바뀌면 더 게 력될꺼같다.-민
signed int a b를 더면 (65535/2) 데가 게 되 -가 나다. (-65536/2)+((30000+30000)-(65536/2-1)) <- 제대로 설명을 못하겠다;;; -
-
~cpp
#include <stdio.h>
main(){
const char *a;
char *b, msg[]="test code";
a = msg;
b = a;
puts(msg);
puts(msg);
}
Note:
-
다. 릭 는 그러까 &a 값만 변 는같다(닌가;;)-민
다. 문 b=a; 다. const char * char * 대 다. 러 러. -
-
~cpp
// 는 대로 되며, 된다.
#include <stdio.h>
main(){
float num;
char data[]="123.12";
num = atof(data);
printf("%f", num);
}
Note:
-
다. f가 고 s다. -민
다. atof로 float변 되만, atof 로 는 더를 가 기 때문 int로 return된다. , num 123 담긴다. ANSI C99는 로 되 면 되 록 변다. -
-
~cpp
main(){
int a, b, c;
a = 0010;
b = 0200;
c = 2000;
printf("a=%d b=%d c=%dn", a, b, c);
}
Note:
-
다. 0 가는 부 린 되는같다. -민
다. 0 면 8로 급된다. 0x <- 16진수 -
-
~cpp
#include <stdio.h>
#include <ctype.h>
main(){
char ss[] = "A2 문";
int i;
puts(ss);
for(i=0; ss[i]; i++){
printf("i=%d %4x(%4d) ", i, ss[i], ss[i]);
if(isdigit(ss[i])) puts("");
else puts("반 문");
}
}
Note:
-
다. ss[] "문"란 단는 isdigit로 다. (드므로.) 것 isdigit로 려면 unsigned char로 면 된다. 기본 char signed다. -
-
~cpp
#include <stdio.h>
main(){
int i;
while(scanf("%d", &i), i)
printf("%d", i);
}
Note:
-
다. 문 문는 가 돼 는같다. -민
다. , 교문 라 로 리다. -
-
~cpp
#include <stdio.h>
main(){
char *p;
gets(p);
puts(p);
}
Note:
-
다. 단 만 다. -민
다. 만 다. -
-
~cpp
// main.h
#define NUM 100
struct a {
int num1;
int num2;
};
// main.c
#include "main.h"
#define NUM 200
main(){
struct a test;
test.num1 = 100;
test.num2 = 200;
printf("%d", test.num1+test.num2);
}
Note:
-
다. -민
다. NUM 가 2 define 되다. 경 나 define된 200로 리된다. -
-
~cpp
// 두 같 linking
//main1.c
static int a = 100;
int mul(int num)
{
printf("a = %d", a);
return num*num;
}
//main2.c
main(){
exturn int a;
printf("a = %d");
printf("%d", mul(100));
}
Note:
-
다. -민
다. static C++ private 다. 나 로만 다는 것 다. -
-
~cpp
// 두 같 linking
// 1.c
main(){
double a, b;
a = 1234.1234;
b = 123.123;
printf("%f", mul(a, b));
}
// 2.c
double mul(double a, double b){
return a*b;
}
Note:
-
다. -민
다. 로 되 기 때문 return int로 바뀐다. 로 return 러 기 는 것다. -
-
~cpp
main(){
Note:
-
-
11 까 답 .










근데 각보다 렵 김 교님 문득 각나ㅋㅋ --
-