一個dll中的代碼 有: int a=3; static int b=5;
有函式定義: static int add(int c,int d){return c+d; }
被加載后: a,b 是存在行程的資料段,還是自己獨立的一個空間? 使用了 static 與沒使用static 的函式定義, 有什么不同。
c語言。
uj5u.com熱心網友回復:
a b是全域的么?如果是的話,是dll的資料段。C中 static 函式是限制函式作用域的,只有當前檔案才能呼叫static函式。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/87256.html
上一篇:josephs.c
下一篇:請幫忙糾錯:error C2228: left of '.x' must have class/struct/union type
