본문 바로가기

Programing/c언어

c언어 &,,| 연산자 && -> and || -> or 라는건 알고 게시죠? & 하나를 쓰면 bit 단위로 and 연산을 합니다 | 하나를 둬도 bit단위로 or 연산을 하게 됩니다 그러니 A & B 가 있다면 a와 b를 2진수로 and 연산을 수행하게 됩니다. 더보기
(c언어) printf "Hello world" #include void main() { printf("Hello world\n"); } 처음 c언어에 입문하면 배우는 언어죠 Hello World 여기에서 앞에 stdio.h는 printf문을 쓰기위해서 포함해주는 헤더 파일인데요 printf문 뿐만 아니라 표준 입출력에 관련덴 함수를 포함하고 있습니다. 자 그럼 다들 쳐보시고 컨트롤 + F5 로 디버깅 해봅시다 더보기
(c언어) main 함수 c언어에서는 main함수가 존재합니다. java 나 android 등도 메인함수가 존재하는데요 이 메인함수의 역활은 바로 디버깅 될때 첫번째로 메인 함수 안에 있는 코드들을 실행하게 됩니다. 그러니 2개 이상이 있으면 안되겠죠? 더보기
(c언어) 프로젝트 생성하기 c언어 사용시 확장자를 .c로 지정해야 한다. 프로젝트 생성후 소스(src) 추가 생성완료 더보기
c언어 바둑판 규칙추가 #2 #include #include #include #include void draw_check01(int column, int row); void gotoxy(int x, int y); void move_arrow_key(char chr, int *x, int *y, int x_b, int y_b); void game_control(void); void display_stone(int matrix[][20][20],int xx,int yy); int checkEnd(int m[2][20][20]); int main(void) { game_control(); return 0; } void game_control(void){ int x=1, y=1, matrix[2][20][20]={0}; int other .. 더보기
c언어 바둑판 #1 #include #include #include void draw_check01(int column, int row); void gotoxy(int x, int y); void number_display(int n); #define X_MAX 79 //가로(열)방향 최대값 #define Y_MAX 24 //세로(행)방향 최댓값 void move_arrow_key(char chr, int *x, int *y, int x_b, int y_b); void game_control(void); int main(void) { game_control(); return 0; } void game_control(void){ int x=1,y=1; char key; do { gotoxy(1,1); draw_check01(.. 더보기