'c' 카테고리의 다른 글
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |
STARTUPINFO si = {0,};
PROCESS_INFORMATION pi;
si.cb = sizeof(si);
TCHAR command[] = "notepad.exe";
SetCurrentDirectory("C:\\windows\\system32");
ZeroMemory(&pi, sizeof(pi));
CreateProcess(
NULL, command, NULL, NULL,
TRUE, 0, NULL, NULL, &si, &pi
);
Browsing Performance Counters (0) | 2011.03.10 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |
// // bit_test.cpp : Defines the entry point for the console application. // #include "stdafx.h" void printbit(char ch); void cast(int value); int main(int argc, char* argv[]) { cast(255); return 0; } void cast(int value) { printf("char\t : \'%c\' \n", (char)value); printf("dec \t : \'%d\' \n", value); printf("hex \t : \'%x\' \n", value); printf("bit \t : "); printbit( (char)value ); printf("\n"); /* 비트연산자 & : AND 두 비트가 1일때만 1 | : OR 두 비트중 하나 이상 1이면 1 ^ : XOR 같으면 0, 다르면 1 ~ : 1은 0 , 0은 1 */ } void printbit(char ch) { int i; for(i=0;i<8;i++) { printf("%d", (ch&0200) ? 1 : 0); if(i==3) printf(" "); ch = ch << 1; } }
Browsing Performance Counters (0) | 2011.03.10 |
---|---|
CreateProcess 예제 (0) | 2008.10.13 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netdb.h> #include <arpa/inet.h> #include <sys/socket.h> #include <string.h> //#define IP "220.90.197." #define IP "211.115.99." int main(int argc, char *argv[]) { struct hostent *host; struct in_addr in; char ipList[1024]; int i; char temp[10]; for(i=1;i<255;i++) { strcpy(ipList, IP); sprintf(temp, "%d", i); strcat(ipList, temp); printf("Current IP: [%s]\t", ipList); inet_aton(ipList, &in); host = gethostbyaddr( (char *)&in, sizeof(in), AF_INET); if( host == NULL ) { // herror("gethostbyaddr"); // exit(1); printf("DomainName: [%s] (failed)\n", ipList); } else { printf("DomainName: [%s] (success)\n", host->h_name); } } return 0; }
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |
const란? (0) | 2008.04.17 |
HDC hdc;
TCHAR s[256];
//WCHAR s[256];
hdc = GetDC(ghWnd);
wsprintf(s, "Hooked Key Code = %3d. \t" , wParam);
TextOut( hdc, 50, 50, s, lstrlen(s) );
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
[msdn] Windows Data Types (0) | 2008.05.09 |
const란? (0) | 2008.04.17 |
The data types supported by Microsoft® Windows® are used to define function return values, function and message parameters, and structure members. They define the size and meaning of these elements. For more information about the underlying C/C++ data types, see Data Type Ranges.
The following table contains the following types: character, integer, Boolean, pointer, and handle. The character, integer, and Boolean types are common to most C compilers. Most of the pointer-type names begin with a prefix of P or LP. Handles refer to a resource that has been loaded into memory.
For more information about handling 64-bit integers, see Large Integers.
http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
const란? (0) | 2008.04.17 |
const란 const 대상이 된 데이터가 변경되면 컴파일러가 에러를 내게 만든 기능입니다.
즉 const 대상 데이터값을 바꾸는 것을 방지하는 기술입니다.
const 같은 경우에는 .. line 이 길어 질수록... 꼭 필요하다고 하네요..
여기서는 간략하게 예시를 제시 했는데..
-------------------------------------------------
float P=3.14; // const float P=3.14;
int main()
{
float rad;
P=3.07; // 이곳에서 실수를...
scanf("%f", &rad);
printf("원의 넓이는 %f\n",rad*rad*P);
return 0;
}
-------------------------------------------------
만약 만라인 이상일 경우를 생각했을경우...
본인은 ... P값을 변경할 경우는 전혀 없다고 생각했을텐데..
본인 실수를 했는지 확인하는 것이... 쉽지 않다는 것이죠 _;
위와 같은 유형의 버그가 밤을 세우게 하고 _ ; 뭐 그렇다네요..
그래서 맨 위 전역 변수에게 ... CONST 라는 선물을 _ ;
CreateProcess 예제 (0) | 2008.10.13 |
---|---|
bit test (0) | 2008.08.21 |
java IpAddress To dns name (0) | 2008.06.08 |
'LPSTR'에서 'LPCWSTR'(으)로 변환할 수 없습니다. (0) | 2008.05.11 |
[msdn] Windows Data Types (0) | 2008.05.09 |