这里记录一些待解决的程序难题
1.
1.这两种内存分配的方式,有什么不一样,
2.初始化的s最后结果有什么不一样
| int main() { struct a { int id; string s; }; a *ptr1 = new a(); ptr1->s = "hello"; a *ptr2 = (a*)malloc(sizeof(a)); ptr2->s = "hello"; system("pause"); return 0; }
|
2.
List容器中empty()判空和size()==0判空有什么不同
3.
为什么函数外的指针的值没有变化
| void getmemory(char *p) { p = new char[100]; strcpy_s(p,12, "hello world"); printf("%s\n", p); return; } int main() { char *p = NULL; getmemory(p); printf("%s\n", p); system("pause"); return 0; }
|
而下面代码却可以改变
| void getmemory(char **p) { *p = (char*)malloc(100); strcpy_s(*p, 12,"hello world"); printf("%s\n", *p); return; } int main() { char *p = NULL; getmemory(&p); printf("%s\n", p); system("pause"); return 0; }
|
4.
UE4热加载
5.
UE4 delegate,UScriptStruct,UProperty
6.
寻路算法