1
노드 구조가 있습니다 (다음 동일한 구조에 값이 들어 있습니다).빈 노드 구조의 JNA 초기화
struct Node {
Node *nextElem;
Element thisValue;
};
빈 (null) node.ByReference를 채우는 함수에 전달하려고합니다. C++ 측면에 null에 대한 포인터들처럼, 목록을 읽으려고 할 때
// C++
Element element = ...; //fills in another function;
Node *list = NULL;
AddElementToList(element, &list);
// which declered as
void AddElementToList (Element element, Node * list) {...}
// Java
Element.ByValue element = ...; //fills great in another function in the same way ByReference (and reconstructed as ByValue),
//but initialize with trash in Pointers and without recurtion;
Node.ByReference list = null;
MyDll.INSTANCE.AddElementToList(element, list);
그래서 나는 잘못된 메모리 액세스 오류가
Node.ByReference list = null;
를 사용하는 경우. 그래서 초기화하려고합니다
목록. 그러나이 경우에 나는
C++ 함수의 선언 및 C++에서의 호출 방법을 보여줄 수 있습니까? – cubrr
아,하지만 노드에 대한 널 포인터에 대한 포인터가 필요할 것 같습니다. 현재 널 포인터를 전달 중입니다. – cubrr
AddElementToList가'(Element element, Node ** list)'가 아닌가? – cubrr