av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

“Helloworld”不簡單

由Kernighan和Ritchie合著的經典教程《The C Programming Language》的開篇***個C程序例子是打印簡單的“hello world”。從此之后,“hello world”就成了描述一個人編寫的***個程序的代名詞——不論是什么語言技術,即使實際上程序并沒有在字樣上輸出“hello world”幾個字。

創(chuàng)新互聯主營中原網站建設的網絡公司,主營網站建設方案,app軟件開發(fā)公司,中原h(huán)5微信小程序定制開發(fā)搭建,中原網站營銷推廣歡迎中原等地區(qū)企業(yè)咨詢

對于初學者來說,這“hello world”程序是讓人恐怖的。他會想“我一定非常笨,連這入門的hello world程序都覺得難。照這樣下去,我一定不會喜歡上編程?!?/p>

其實,這問題的原因是我們把“***個”和”最簡單的一個“混淆了?!癶ello world”程序可以是任何的程序,沒有難易限制。當你***次編程時,你不知道該用哪種編譯器、不知道代碼文件應該放到哪里、不知道它們應該是什么格式,等等。你需要去學。大量的知識在你真正能夠編程前都需要學習、慢慢的學會 。

本文的作者 John D. Cook

當我最初開始學習編程時,我總希望能盡快的越過寫“hello world”程序的階段,希望能夠立刻開始編寫真正有用的程序。但事實上,我發(fā)現我大半輩子時間都在寫“hello world”程序,而且看不到結束的盡頭。

每當討論起“hello world”程序,幾乎避免不了的要說一說這世界上最恐怖的“hello world”程序:Charles Petzold在他的《Programming Windows》一書中描述的***個Windows程序。我只能找到這本書的Windows 98版的。不知道它跟最初的原版有多大區(qū)別,但我印象里原版里的代碼會比現在這個更恐怖。

 
 
  1. /*------------------------------------------------------------
  2.    HELLOWIN.C -- Displays "Hello, Windows 98!" in client area
  3.                  (c) Charles Petzold, 1998
  4.   ------------------------------------------------------------*/
  5.   
  6. #include 
  7.   
  8. LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
  9.   
  10. int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
  11.                     PSTR szCmdLine, int iCmdShow)
  12. {
  13.      static TCHAR szAppName[] = TEXT ("HelloWin") ;
  14.      HWND         hwnd ;
  15.      MSG          msg ;
  16.      WNDCLASS     wndclass ;
  17.   
  18.      wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
  19.      wndclass.lpfnWndProc   = WndProc ;
  20.      wndclass.cbClsExtra    = 0 ;
  21.      wndclass.cbWndExtra    = 0 ;
  22.      wndclass.hInstance     = hInstance ;
  23.      wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
  24.      wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
  25.      wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
  26.      wndclass.lpszMenuName  = NULL ;
  27.      wndclass.lpszClassName = szAppName ;
  28.   
  29.      if (!RegisterClass (&wndclass))
  30.      {
  31.           MessageBox (NULL, TEXT ("This program requires Windows NT!"),
  32.                       szAppName, MB_ICONERROR) ;
  33.           return 0 ;
  34.      }
  35.        
  36.      hwnd = CreateWindow (szAppName,                  // window class name
  37.                           TEXT ("The Hello Program"), // window caption
  38.                           WS_OVERLAPPEDWINDOW,        // window style
  39.                           CW_USEDEFAULT,              // initial x position
  40.                           CW_USEDEFAULT,              // initial y position
  41.                           CW_USEDEFAULT,              // initial x size
  42.                           CW_USEDEFAULT,              // initial y size
  43.                           NULL,                       // parent window handle
  44.                           NULL,                       // window menu handle
  45.                           hInstance,                  // program instance handle
  46.                           NULL) ;                     // creation parameters
  47.        
  48.      ShowWindow (hwnd, iCmdShow) ;
  49.      UpdateWindow (hwnd) ;
  50.        
  51.      while (GetMessage (&msg, NULL, 0, 0))
  52.      {
  53.           TranslateMessage (&msg) ;
  54.           DispatchMessage (&msg) ;
  55.      }
  56.      return msg.wParam ;
  57. }
  58.   
  59. LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  60. {
  61.      HDC         hdc ;
  62.      PAINTSTRUCT ps ;
  63.      RECT        rect ;
  64.        
  65.      switch (message)
  66.      {
  67.      case WM_CREATE:
  68.           PlaySound (TEXT ("hellowin.wav"), NULL, SND_FILENAME | SND_ASYNC) ;
  69.           return 0 ;
  70.             
  71.      case WM_PAINT:
  72.           hdc = BeginPaint (hwnd, &ps) ;
  73.             
  74.           GetClientRect (hwnd, &rect) ;
  75.             
  76.           DrawText (hdc, TEXT ("Hello, Windows 98!"), -1, &rect,
  77.                     DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
  78.             
  79.           EndPaint (hwnd, &ps) ;
  80.           return 0 ;
  81.             
  82.      case WM_DESTROY:
  83.           PostQuitMessage (0) ;
  84.           return 0 ;
  85.      }
  86.      return DefWindowProc (hwnd, message, wParam, lParam) ;
  87. }

網頁名稱:“Helloworld”不簡單
標題路徑:http://uogjgqi.cn/article/codseps.html
掃二維碼與項目經理溝通

我們在微信上24小時期待你的聲音

解答本文疑問/技術咨詢/運營咨詢/技術建議/互聯網交流