본문 바로가기

분류 전체보기

while문, do while문 while.c#include void main(){ int num = 0; while (num =5 가 되면 탈출하게 된다. 즉 조건을 만족하지 않는다면 탈출하게 된다. { printf("Hello world! %d \n", num); num++; } return;}do_while.c #include void main(){ int num = 0; do{ printf("Hello world! %d \n", num);//while문가 조금은 다른데, //1. 일단 실행한 후에 num++; } while (num =5 가 되면 탈출하게 된다. 즉 조건을 만족하지 않는다면 탈출하게 된다. //2. 반복여부를 확인한다. //3. 재실행을 위해 위로 이동한다. return;// return 0이나 return은 m.. 더보기
더비카운티 : QPR 경기에서 호일렛의 돌파후 크로스로 보비 자모라의 골로 승격 확정 더비카운티 : QPR 경기에서 호일렛의 돌파후 크로스로 보비 자모라의 골로 승격 확정 ( 89분쯤?)2014년 4월 25일 더보기
malloc // 메모리 할당 : 힙영역 // void* malloc(size_t size); -> 메모리 할당 // void free(void* ptr); -> 메모리 해제 // void* calloc(size_t element_count, size_t element_size); // void* realloc(void* ptr, size_t size); #include #include char* ReadUserName(void) { //char name[30]; //char* p = (char*)malloc(sizeof(char) * 30); char* p = (char*)calloc(30, 1); p = (char*)realloc(p, sizeof(char)*50); printf("name : "); gets_s.. 더보기
Mathf.Sin, Mathf.Cos Mathf.Deg2Rad, 삼각함수 디버깅 using UnityEngine;using System.Collections; public class MathfSinCosPrint : MonoBehaviour { // Use this for initialization void Start () { print("삼각함수"); float sin0 = Mathf.Sin(0 * Mathf.Deg2Rad); print("sin0 = 0 ," + sin0); float sin30 = Mathf.Sin(30 * Mathf.Deg2Rad); print("sin30 = 1/2 ," + sin30); float sin45 = Mathf.Sin(45 * Mathf.Deg2Rad); print("sin45 = 루트2/2 ," + sin45); float sin60 = Mat.. 더보기
Visual Studio 2013 Update1, Update 2 RC 성공 후 MFC 실패 후기 설치할려고 하는 Visual Studio Express 2013 for Desktop 을 설치하고 나서 이 설치 과정을 보는것을 권장한다. Visual Studio 2013 업데이트 2 RC의 링크이다 http://www.microsoft.com/ko-kr/download/details.aspx?id=42307 더보기
C언어 구조체 에러가 좀 있음 출력은 되는데 #include typedef struct { int no; char *user_id; char *user_name; char *user_phone; int user_level; int user_hp; int user_mp; }GameRanking; void main() { int i; GameRanking RiderRanking[5] = { {1, "remake_master", "이*구","082-0000-0001", 15, 300, 300}, {2, "remake_db_master", "정*호", "082-0000-0002", 12, 400, 600}, {3, "remake_server_master", "함*호", "082-0000-0003", 16, 200, 900}, {4, "remake_game.. 더보기
pow 제곱 연산 void pow2(){ int i=0;; int num = 1; string a; for(num=1;num 2048) break; } } 더보기
입출금 소스 #include //standard input output #include //standara library void printAllMenu(); int bank_num=13; void main() { if (bank_num == 13){ bank_num = 13; printAllMenu(); } printf("-----Z 은행입니다.------\n"); printf("숫자를 선택해주세요.\n"); while (1){ int num;a scanf_s("%d번\n", &num); if (num == 1){ bank_num = 1; } if (num == 2){ bank_num = 2; } if (num == 3){ bank_num = 3; } if (num == 4){ bank_num = 4; } if (.. 더보기
C 언어 1. atoi('문자열') => 숫자 ex) "1234" => 1234 2. itoq(숫자) => 문자 ex) 1234 => '1234' int i; i=1234; string s; 3.strcpy strlen("문자"); 4. strcmp(문자1,문자2) ex)("AB","A") => O or 1.2 더보기
C++ 배열과 포인터 #include //Standard INPUT OUTPUT //배열의 이름은 주소다. void main() { char ch[] = "ryadj"; char* p; //char 포인터형 변수 p를 선언 p = ch;//p에 ch의 주소값이 올라와있다. printf("%c \n\n", *p);//ch의 주소값이 들어가 있는 0번째 위치에 있는 r 출력 for (int i = 0; i < 5; i++){ printf("%c", *(p+i));//ryadj } } 더보기