flagflag  
2: 2010-09-30 (Thu) 11:30:31 s10037 source 3: 2010-10-23 (Sat) 01:08:14 s10037 source
Line 1: Line 1:
TITLE:C言語 TITLE:C言語
-*ああああ [#f04659ea+*C言語_オバラのwiki [#f02ac1c7
-いいいい +勘違いや間違い、キティーガイ沙汰な事を書いている可能性(大) 
-**うううう [#x3207220] +**予約語 [#h0341d94]
-ええええ+
-***おおおお [#m1521625+ 
-かかかかか +***予約語 [#u5fb9dce
-ききき+void     型の無いことを宣言~ 
-くくく+char     1バイト・文字型
 +short     2バイト・単精度整数型~ 
 +int      4バイト・整数型~ 
 +long      4バイト・整数型~ 
 +float     4バイト・単精度浮動小数点型~ 
 +double    8バイト・倍精度浮動小数点型~ 
 +auto     自動変数、関数を抜けるとデータは消去~ 
 +static    静的変数、関数を抜けてもデータが残る~ 
 +const    書き換え不可、宣言時に格納~ 
 +signed    符号付変数を指定~ 
 +unsigned   符号なし変数を指定~ 
 +extern    異なるファイルから使用する際に宣言~ 
 +volatile   コンパイラに最適化させない~ 
 +register   レジスタに割り当て高速化、C++では使用できるが意味が無い~ 
 +return    関数から抜ける、戻り値を指定できる~ 
 +goto    指定ラベルへジャンプ~ 
 +if      条件分岐~ 
 +else     if文の条件分岐~ 
 +switch   条件分岐~ 
 +case    switchでの条件分岐~ 
 +default   switchでのcaseに当てはまらない条件~ 
 +break    ブロックから抜ける~ 
 +for     ループ文(初期化;終了条件;変数更新)~ 
 +while    ループ文(終了条件)~ 
 +do     do-while文で使用する、処理の開始~ 
 +continue  ループ文の先頭に戻る~ 
 +typedef   型に別名をつける、意味は変わらず~ 
 +struct    構造体、変数をまとめて宣言するユーザー定義型~ 
 +enum    列挙型、整数の割り当て~ 
 +union    共用体、変数をまとめて宣言できるが、アドレスは共通~ 
 +sizeof   変数のサイズを取得~ 
 + 
 +**win32API [#xd9a6814] 
 +***ウィンドウ生成 [#t07e989f] 
 +#include<windows.h>~ 
 +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);~ 
 +ATOM InitApp(HINSTANCE);~ 
 +BOOL InitInstance(HINSTANCE, int);~ 
 + 
 +LPCTSTR lpszClassName = TEXT("win01.cpp");~ 
 + 
 +int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,LPSTR lpsCmdLine, int nCmdShow)~ 
 + 
 +{~ 
 +    MSG msg;~ 
 +    BOOL bRet;~ 
 + 
 +    if(!InitApp(hCurInst))~ 
 +     return FALSE;~ 
 +    if(!InitInstance(hCurInst, nCmdShow))~ 
 +     return FALSE;~ 
 +    while ((bRet = GetMessage(&msg, NULL, 0,0)) != 0)~ 
 +    {~ 
 +     if (bRet == -1)~ 
 +     {~ 
 +     break;~ 
 +     }~ 
 +     else~ 
 +     {~ 
 +     TranslateMessage(&msg);~ 
 +     DispatchMessage(&msg);~ 
 +     }~ 
 +    }~ 
 +    return (int)msg.wParam;~ 
 +}~ 
 +//ウィンドウクラス登録~ 
 +ATOM InitApp(HINSTANCE hInst)~ 
 +{~ 
 +    WNDCLASSEX wc;~ 
 +    wc.cbSize = sizeof(WNDCLASSEX);~ 
 +    wc.style = CS_HREDRAW | CS_VREDRAW;~ 
 +    wc.lpfnWndProc = WndProc;~ 
 +    wc.cbClsExtra = 0;~ 
 +    wc.cbWndExtra = 0;~ 
 +    wc.hInstance = hInst;~ 
 +    wc.hIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(IDI_APPLICATION), 
 +     IMAGE_ICON, 0,0, LR_DEFAULTSIZE | LR_SHARED);~ 
 +    wc.hCursor = (HCURSOR)LoadImage(NULL, MAKEINTRESOURCE(IDC_ARROW), 
 +    IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE | LR_SHARED);~ 
 +    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);~ 
 +    wc.lpszMenuName = NULL;~ 
 +    wc.lpszClassName = lpszClassName;~ 
 +    wc.hIconSm = (HICON)LoadImage(~ 
 +     NULL,MAKEINTRESOURCE(IDI_APPLICATION), IMAGE_ICON, 
 +     0, 0, LR_DEFAULTSIZE | LR_SHARED);~ 
 + 
 +    return (RegisterClassEx(&wc));~ 
 +}~ 
 +//ウインドウの生成~ 
 +BOOL InitInstance(HINSTANCE hInst, int nCmdShow)~ 
 +{~ 
 +    HWND hWnd;~ 
 + 
 +    hWnd = CreateWindow(lpszClassName,~ 
 +     TEXT("クソゲー"),~ 
 +     WS_OVERLAPPEDWINDOW,~ 
 +     CW_USEDEFAULT,~ 
 +     CW_USEDEFAULT,~ 
 +     CW_USEDEFAULT,~ 
 +     CW_USEDEFAULT,~ 
 +     NULL,~ 
 +     NULL,~ 
 +     hInst,~ 
 +     NULL);~ 
 +    if(!hWnd)~ 
 +     return FALSE;~ 
 +    ShowWindow(hWnd, nCmdShow);~ 
 +    UpdateWindow(hWnd);~ 
 +    return TRUE;~ 
 +}~ 
 + 
 +//ウインドウプロシージャ~ 
 +LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)~ 
 +{~ 
 +    switch (msg)~ 
 +    {~ 
 +    case WM_DESTROY:~ 
 +     PostQuitMessage(0);~ 
 +     break;~ 
 +    default:~ 
 +     return(DefWindowProc(hWnd, msg, wp, lp));~ 
 +    }~ 
 +    return 0;~ 
 +}~


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthMay 2024Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today

Who's Online

25 user(s) are online (4 user(s) are browsing xpwiki)

Members: 0
Guests: 25

more...

Access Counter

Today : 1023102310231023
Yesterday : 5790579057905790
Total : 2365381923653819236538192365381923653819236538192365381923653819
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com