C(3)
-
[C 04.03] 02. mysql접속하기
#include #include #include "mysql.h" int main(int argc, char *argv[]) { MYSQL *conn_ptr; conn_ptr = mysql_init(NULL); if(!conn_ptr) { fprintf(stderr, "mysql_init failed\n"); return 1; } conn_ptr = mysql_real_connect(conn_ptr,"호스트명","계정ID","계정PW","데이터베이스명",0,NULL,0); if(conn_ptr) { printf("Connection success\n"); }else{ printf("Connection failed\n"); } mysql_close(conn_ptr); return 0; }
2011.04.03 -
[Algorism 11.05] 2010 4회 기사시험 문제 코딩한거
요게 이번 기사 문제였다...이번문제 은근히 쉬웠는거 같다... 다음번에는 어떻게 나올지 모르겠지만서도...ㅋㅋ 하여튼 코딩할때 포문 몇개 나올줄 알았더니 두개면 되넹... 이상한 머리가 요세 발달해가는거 같애...젠장... int tmain() { int s=0,e=6; for(int i=1;i=i) { s=s+1; e=e-1; } else { s=s-1; e=e+1; } for(int j=1;j
2010.11.05 -
[C 09.09] 01. C언어 기초 통틀어
뭐 별 어려움 없이 할 수 있기 때문에 그냥 짧게 짤게 사용법만 정리 할께요..^^ 1. 먼저 잘쓰는 자료형 int 4byte 정수형 123 float 4byte 실수형 (고정형) 2*10^2 double 8byte 실수형 (움직이는거) 200.000 char 1byte 문자 'a' string 32bit 컴퓨터는 32byte 64bit 컴퓨터는 64byte 문자열 "asdf" string의경우 string.h를 선언해줘야 한다. 사용자 자료형 struct A { int a; double b; char c; }; 사용할 땐 struct A 변수명; A.a=1; A.b=2.0; A.c='c'; 배열 int a[3]; 0 1 2 3 요런 형태로 된다. a[0]=1; a[1]=2; a[2]=3; 이런식으로 값..
2010.09.09