------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// hello.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
//
#include "stdafx.h"
#include<windows.h>
#include<math.h>
#include<time.h>
#include<stdlib.h>
#include<algorithm>
#define PI 3.14
using namespace std;
#pragma warning (disable : 4996)
bool compare(int a, int b) // 내림차순 전용
{
return a > b;
}
bool compare2(const abc &one, const abc &two) // 오름차순 구조체 전용
{
return one.a < two.a;
}
struct abc {
int a;
char b;
};
abc A[12];
int main()
{
// printf("hello eunchan!\n");
//printf("sin 45도 = %f",sin(45 * PI/ 180));
//srand((int)time(NULL));
//for(int i=1;i<=10;i++)
// printf("%d\n",rand() % 10000+1); // 10000이하의 수 랜덤출력
//
//int A[10] = { 5,3,8,2,6,50,7,15,178,385 };
//sort(A,A+10,compare); // 내림차순
//for (int i = 0; i <= 9; i++)
// printf("%d\n",A[i]);
//sort(A, A + 10); // default는 오름차순
//for (int i = 0; i <= 9; i++)
// printf("%d\n", A[i]);
/*for (int i = 1; i <= 10; i++) // 구조체 입력하고 오름차순으로 정렬
{
scanf("%d",&A[i].a);
}
printf("\n");
qsort(A+1,10,sizeof(A),compare2);
for (int i =1; i <= 10; i++)
printf("%d\n",A[i].a);*/
system("pause");
return 0;
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
targetver.h 는 윈도우 7,8,10의 모든 dll파일은 다르기 때문에 코드도 조금씩 다르다
그걸 여기다 다 정리해서 신경쓸필요없게 만듬 ㅋ
deg 개발자용 realse 배포용
개발자들은 only deg만 씀
한글, 중국어처럼 한글자당 2바이트를 와일드 캐릭터라함 아주 야생적임
그래서 따로 처리해야함 wprintf w붙은거나 _t 같은 게 와일드 버전임
'게임프로그래밍(c++)' 카테고리의 다른 글
4. 연관 컨테이너들 , set ~ (0) | 2017.03.29 |
---|---|
3.템플릿과 STL (0) | 2017.03.22 |