Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-04-2005, 11:33 AM   #1 (permalink)
kb
Right Off the Assembly Line
 
Join Date: Aug 2004
Posts: 10
Default HowTo convert C struct with array of another struct in java


How to convert C code(given below) in java

C code:
struct structA {
int varA[4];
float varB[2];
}

struct structB {
int len;
structA varC[50];
}

void main {
structB varD[10];
.....
.....
somefunction(varD) {
.....
}
}

Here i have a structure A with variables of different data types(some are array)

And also i have a structure B with some variables (one of the variable is of data type of structure A [mind u this is an ARRAY])

In the C code im using array of structure B
And initialising the values of the variable of structure A, obviiously using the dot operator

This works perfectly in C.

In java i used class insted of structure, i thought it would work
But it gives error while initialising values of the variable of structure A( that is class A).
__________________
╔══════ ═══════╗
║░My Sig♪ Nature ♪░║
║░░░☺ÖLΓußpα░░░║
╚══════ ═══════╝
kb is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 08-04-2005, 12:59 PM   #2 (permalink)
Wise Old Owl
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,208
Default

Actually you dont need to use classes. Use collections Instead. Collections can be anything. Objects, Arrays and so on. Can you copy paste the code that you wrote ? Perhaps we can work it from there
__________________
AMD 64 3500+ Venice
DFI Lan Party Ultra-D
2* 512 MB PdP Memory with 2-2-5L timings
XFX 7900GT 256 MB Card
icecoolz is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by ico
- by clinton
- by icebags
- by Charan
- by Piyush

Advertisement




All times are GMT +5.5. The time now is 12:49 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2