2 부분의 응용 프로그램 인 Delphi와 C가 있는데 질문이 두 개 있습니다. 1. 매개 변수를 Delphi에 전달하는 가장 빠른 방법은 무엇입니까? Delphi/C로 전달하는 매개 변수가 더 빠름
-
내가 C의 포인터가 전달 파라미터 싶어 난 싶어 전체 배열을 전달 그것의 제 1 부분을 절단하고, 나머지 통과하지 못한 문자 배열과 기능을 가지고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
void testfunction(char **Data) { printf("Data = %d\n", *Data); return; } int main() { char Data[] = "TEST FUNCTION"; testfunction(&&Data[4]); // Error return 0; }
감사
문자열 데이터를 C DLL에서 Delphi로 전달해야하는 경우 LPCSTR (char *) 및 LPWSTR (wchar_t *)과 동일한 델파이 인터페이스에서 PAnsiChar 또는 PWideChar 유형을 사용하십시오. –
@Warren'LPCSTR'은 실제로'const char *'입니다. 일반적으로'LPSTR'과'LPWSTR' 또는'LPCSTR'과'LPCWSTR'을 조합합니다. –
맞습니다. 나는 더 이상 그 주석을 편집 할 수 없으므로 그 점을 지적 해 주셔서 감사합니다. –