简体   繁体   中英

JNA Pointer Pass

test.h

struct test{

char  *pCarrierName;

}

And Equivalent JNA Syntax is-

public static class test extends Structure {

    public Pointer pCarrierName;    
      public test( Pointer pCarrierName) {

                super();     

                this.pCarrierName = pCarrierName;


            }
}

Now how can i instantiate this "test" class? Actually i want to do following this type of call-

public static void main(String[]args){
       test ob = new test("AIR GAS");
}

The structure field should be of type String; then you can initializer the structure and its field with the original String argument.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM