C:
					
typedef struct Example4Struct {
	int val;
} Example4Struct;
...
Example4Struct example4_getStruct()
{
	Example4Struct sval;
	sval.val = 23;
	return sval;
}
					
				
Java:
					
public interface CLibrary extends Library {
	public static class Example4Struct extends Structure {
		public static class ByValue extends Example4Struct implements Structure.ByValue {}
		
		public int val;
	}
	...
	public Example4Struct.ByValue example4_getStruct();
}
...
CLibrary clib = (CLibrary)Native.loadLibrary("testlib", CLibrary.class);
...
CLibrary.Example4Struct.ByValue e4val = clib.example4_getStruct();
System.out.println("example 4: " + e4val.val);

//www.sitcoder.com
				        
                        
                                                                    
						
						
						
									  				


	
色迷迷 哭 呕吐 大笑 口水 微笑 啵一个 发怒

Hi,您需要填写昵称和邮箱!

  • 必填项
  • 必填项