목록C (54)
SPRING :: NOTE
#define _CRT_SECURE_NO_DEPRECATE #include "stdio.h" #include "windows.h" #include "stdafx.h" typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; void Sum(void* p); void main() { char temp[1024]; printf("sum\n"); DWORD dwThreadld; SUMINFO si = { 1, 100, 0 }; HANDLE h = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Sum, &si, NULL, &dwThreadld); CloseHandle(h); scanf_s(temp); } void Sum(void..
#define _CRT_SECURE_NO_DEPRECATE #include "windows.h" typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; DWORD WINAPI Sum(void* p); HANDLE g_hConsoleOut; void writeString(LPCTSTR lpszFormat, ...) { char str[1024] = { 0 }; va_list argList; DWORD dwNumberOfBytesWritten; va_start(argList, lpszFormat); wvsprintf(str, lpszFormat, argList); va_end(argList); WriteFile(g_hConsoleOut, str, lstrle..
#include #include #include #include typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; unsigned _stdcall Sum(void* p); void WriteString(const char* lpszFormat, ...) { char str[1024] = { 0 }; va_list argList; va_start(argList, lpszFormat); vprintf(lpszFormat, argList); // 런타임 함수 va_end(argList); } void main() { char temp[1024]; unsigned dwThreadId; printf("*** 예제 C Runtime Library를 이용한 스레..
아주 단순한 바이너리 파일 변환기 temp에 저장해서 한방에 바이너리로 변환해준다. /* Libraries */ #include #include #include #include #pragma warning(disable : 4996) #define _CRT_SECURE_NO_DEPRECATE void main() { FILE *f; char temp[] = { 0x00, 0x00, 0x02, 0xc8, 0x00 }; f = fopen("bin.bin", "wb"); fwrite(temp, 1, 5, f); fclose(f); }
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 해결 : It is a stressfull job moving from one version of VC++ to another without microsoft making is worse by adding: C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _ito..
Code Jock의 XTToolkitPro를 처음 사용해봤다. C++도 처음, XTToolkitPro도 처음. XTToolkitPro를 사용하기 위해 사용자 환경 설정을 남긴다. XTToolkitPro는 알아서 설치하셨다는 생각으로 글을 이어나간다. 내컴퓨터 우클릭 -> 속성 -> 고급 시스템 설정 -> 고급 탭 -> 환경변수 시스템 변수 그룹의 새로만들기 클릭 변수이름 : 알아서 지정변수 값 : CodeJock의 XTToolkitPro 설치 경로 지정 Visual Studio 실행 새 프로젝트를 실행시켜 Dialog 프로젝트를 생성한다. 다이얼로그 프로젝트에 Code Jock의 XTToolkitPro Path를 지정해준다. 속성관리자를 열어준다. 속성 관리자의 위치는 VS 버전별로 다르며, 이전버전은 ..