typedef on Java?
I've to import some code from C to Java , so I've some trouble with the 'typedef' :
For Example :
typedef MY_TYPE T_INPUT [MAX_INPUT] ; //My Type Already declared as a struct
static T_INPUT t_input[MAX_INPUT][MAX_INPUT];
JAVA : Any Idea ?
(via C++ to Java Converter)
private static MY_TYPE t_input = new MY_TYPE[MAX_INPUT][MAX_INPUT][MAX_INPUT];
Last edited by David Anton; 05-25-2009 at 11:18 AM.
Reason: originally posted conversion was wrong
Thx ; )
For the typedef I just convert it into a class , I think it's the only way to make it as a Type in Java !!
S_INPUT_TYPE T_INPUT=new S_INPUT_TYPE[MAX] ;
T_INPUT [ ][ ]T_input_=new T_INPUT[MAX][MAX];
If you want it as a separate type, I guess thats the way. But beware, converting between T_INPUT and MY_TYPE may introduce problems. It may be better to use MY_TYPE directly wherever required.
Last Post: 09-19-2007, 06:58 AM
Last Post: 06-14-2006, 04:16 PM
Last Post: 05-13-2005, 07:46 AM
By JJ in forum Enterprise
Last Post: 07-06-2000, 05:50 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL