預處理發生了什麼

2021-07-23 15:09:28 字數 839 閱讀 2891

預處理主要處理以#開頭的東西和注釋,如下c++**:

vs2008預設不保留預處理檔案,如果要檢視,請設定 屬性  -c/c++ - 預處理器 - 生成預處理檔案

// study.cpp : 定義控制台應用程式的入口點。

//#include "gpsheader.h"

#define __use_polar_radius__

/* polar_radius */

#define polar_radius 6356908.8

/* equatorial_radius */

#define equatorial_radius 6377830.0

#define gps_pi 3.141592654

#int main()

int single()

#pragma once

int single();

預處理後生成*.i檔案 如下

#pragma once

int single();

int main()

int single()

從以上結果可以看出,帶#的都被處理了

1. #define行都消失了,所有巨集定義被代替

2. 條件編譯被執行

3.注釋被刪除

4. #include 後的檔案被複製到#include處

5. #program 保留

6. 單獨的沒有意義的#也被刪除

還可以看出被刪除的內容恰好對應*.i檔案中的空行

new Vue 發生了什麼

合併options 初始化生命週期 初始化事件 初始化渲染 觸發beforecreate鉤子 export function initstate vm component else true asrootdata if opts.computed initcomputed vm,opts.compu...

http enter以後發生了什麼?

自己總結 輸入 按enter發生了什麼?寫在前面的話 http www.google 8080 script jquery.js http協議名稱 www 子網域名稱 google 主網域名稱 8080埠號 script jquery 請求位址 當協議 子網域名稱 主網域名稱 埠號中任意乙個不同的時...

輸入url發生了什麼

1 瀏覽器的位址列輸入url並按下回車 2 dns解析url對應的ip 3 根據ip位址建立tcp連線 4 http發起請求 5 伺服器處理請求,瀏覽器接受http響應 6 渲染頁面,構建dom樹 7 關閉tcp連線 1 輸入url 常見的url是形如 http 這個網域名稱由三部分組成 協議名 網...