unity是可以完成一整個程式的framework
Time& Time::set(...){
...
return *this;
}
Time* timeObj = &anotherTimeObject
就是 令 timeObj 和 anotherTimeObject 連結在一起
timeObj是anotherTimeObject的view
*variable 是如果variable是一個Pointer的話,存取variable目前記憶體位置下的內容
如果variable是pointer的話,variable++ 代表往右移動 sizeof(T) 的 byte
那像是
class A(){
public:
int p;
}
A *a;
*a.p 還是說
*a->p還是
a->p
如果*a回傳pointer不就是第二種...?
-> 代表讀取 pointer of Class 的內容
所以為甚麼是是 return *this
因為他自己是個pointer,他要回傳自己
另外 Time& 是代表回傳的是一個Time物件的參考
int a =5;
ri = a;
就只是alias嗎
ostream& operator«(T);
...
我可以cout « a « b « c;
為什麼回傳值會是alias的語法...? , 不應該直接 ostream operator«(T); ?
為什麼回傳值會是alias的語法...? , 不應該直接 ostream operator«(T); ?
那你要不要YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Parent a = new Sub();
a.overridedMethod()
不然 Parent* p = new Sub();
p.method() //執行Parent的
看起來就是跟java的final性質相反(某些層面稍微不同)的東西
一個是,我沒有宣告的你都不能蓋掉,一個是,我沒有宣告的你都可以蓋
喔喔喔 我"猜" 會是virtual method
甚至可以catch(int){}喔OAO
不用寫變數名
@licson const FunctionCallbackInfo<Value>& args
這怎麼會是Array
Class可以有Operator Overload
他可以指定 public operator [] (int i) …
喔喔喔 原來[]是一個 operator,隨手翻完,有些印象不深
是說突然覺得他比 player/index.html 更適合
@licson Qt怎麼快速上手,或者是推薦別的framework之類的
這裡目前有一個兩個人在踩的大洞,而且暫時還看不到盡頭(?
void *GetAnyGLFuncAddress(const char *name)
{
void *p = (void *)wglGetProcAddress(name);
if(p == 0 ||
(p == (void*)0x1) || (p == (void*)0x2) || (p == (void*)0x3) ||
(p == (void*)-1) )
{
HMODULE module = LoadLibraryA("opengl32.dll");
p = (void *)GetProcAddress(module, name);
}
return p;
}Holy cr*p, what's this
This function takes an ASCII string that exactly matches (case-sensitive) the function name in question
我知道拉 只是我想說如果不看這個,我覺得我就想去用Qt了
The wglGetProcAddress function returns the address of an OpenGL extension function for use with the current OpenGL rendering context.
static __declspec(dllexport) double add(...);
只要給出函數名稱和定義就可以自動在DLL裏找出相應的Symbol
gcc要用指令去bind static library
我就要
#include "______dll.h"
#pragma comment(lib, "_________dll")
要用 LoadLibrary 這個 WinAPI函式動態載入
有Static Library通常就是人家的大型函式庫
你會看到有Header檔案和Static Library還有一份DLL
// this is a function called functionFactory which receives parameter n
// and returns a pointer to another function which receives two ints
// and it returns another int
int (*functionFactory(int n))(int, int) {
printf("Got parameter %d", n);
int (*functionPtr)(int,int) = &addInt;
return functionPtr;
}
@licson 所以VC++載入dll是用Implicity Link?
你直接上個code formater可能比較快(?