我有两个应用程序,分别是Delphi和C语言编写的。我有两个问题: 1. 传递参数到Delphi的最快方法是什么?
procedure name(Data: string); // Data is Copied to another location before passing so its slow
procedure name(var Data: string); // Data is Passed by pointer, Faster
procedure name(const Data: string); // unknown
i wanna pass parameters by pointers in c, i have a char array and a function, i don't wanna pass the whole array, cut a first part of it and pass the rest
void testfunction(char **Data) { printf("Data = %d\n", *Data); return; } int main() { char Data[] = "TEST FUNCTION"; testfunction(&&Data[4]); // Error return 0; }
谢谢
LPCSTR
实际上是const char*
。通常你会将LPSTR
和LPWSTR
或者LPCSTR
和LPCWSTR
配对使用。 - David Heffernan