|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

01-29-2008, 08:14 AM
|
 |
Senior Member
|
|
Join Date: Nov 2007
Location: New York
Posts: 143
|
|
|
C++
I bet there are probably some people on this forum who know C++.
I have decided to create a Java to C++ (and C++ to Java) code converter. Obviously applets and graphical programs cannot be converted.
So here's my question.
I have seen in C++ things that i have never seen in Java such as pointers (*) and reference(&). I've also seen things such as struct, union, etc. Is it possible to implement these things in Java code, or will this just be a waste of my time?
__________________
//Haha javac, can't see me now, can ya?
|
|

01-29-2008, 10:53 AM
|
 |
Senior Member
|
|
Join Date: Dec 2007
Location: South Africa
Posts: 334
|
|
|
Java difference
Hello gibsonrocker800
Java is very different from C++. Java does not allow you two work with pointers like C++ - it is done automatically when you work with objects. You will be better off to translate the code yourself. Here is an interesting link if you are interested. 
__________________
If your ship has not come in yet then build a lighthouse.
|
|

01-29-2008, 12:32 PM
|
 |
Moderator
|
|
Join Date: May 2007
Posts: 1,272
|
|
Hi gibsonrocker800,
I think that will be very time consuming project. I reccomend you to work on projects that will improve your abilities to manage your long term goals. At the end, you can find lots of projects to implement which can be very useful to people. But life time is limited. You will better try to optimize it before it is too late 
|
|

01-29-2008, 01:11 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,959
|
|
|
What I have seen there is in C++(actually in standard C++, not MFC) you can work in lower level with variables and functions. Specially used pointers and reference in that manner of C++. But Java not like that. Packages, inbuilt classes are used there, like MFC use C++ wrap class.
Hence, two languages are runs on completely different levels, this project can be really a big one.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

01-29-2008, 08:16 PM
|
 |
Senior Member
|
|
Join Date: Nov 2007
Location: New York
Posts: 143
|
|
|
Yeah i understand how different the languages are, so i was thinking about making it apparent to the user the things they can't do (pointers, graphics, etc.)
As for the time-consuming part:
I have a year to complete this project. If anyone saw, i posted a thread about an Intel Competition, and this is the project i am going to do for it. I was thinking about just coming up with a new idea but i'm having trouble, and my teacher says she likes this idea.
With all of the negative aspects aside, let me know what you guys think of my design choice.
-A class that breaks up the code into arrays of lines.
-A class that uses the previous class, then it breaks each segment up.
Ex: System.out.println("Hey");
becomes an array of Strings:
s[0] = System
s[1] = .
s[2] = out
etc.
That second idea i haven't implemented yet, because I"m not sure how its gonna work. Originally i had it break it up according to white space, this, obviously won't work as desired. If anyone has any suggestions for the design, please let me know, i need all the help i can get. Also, if you have any other ideas for the competition, let me know.
Thanks guys.
__________________
//Haha javac, can't see me now, can ya?
|
|

01-29-2008, 08:29 PM
|
 |
Moderator
|
|
Join Date: May 2007
Posts: 1,272
|
|
|
I also recommend you to do a good search on the subject. I remember a tool to do this partially but i might be wrong.
|
|

01-29-2008, 08:32 PM
|
 |
Senior Member
|
|
Join Date: Nov 2007
Location: New York
Posts: 143
|
|
|
Well i mean i don't think they look for originality because people have made their own compilers for this competition. But yeah, if you see the link that tim posted, this idea has already been implemented, unfortunately. But i mean, i'm thinking of new ideas. I want to make something that has never been done before.
__________________
//Haha javac, can't see me now, can ya?
|
|

04-24-2008, 05:31 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
|
|
I want to make something that has never been done before
Try to make an Anti-Virus for PC in java....
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-25-2008, 06:18 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 386
|
|
|
Try making a video game that is good in java, which is impossible (LOL JK). How about a bit torrent.
|
|

04-25-2008, 06:24 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,959
|
|
|
Making your own IDE is more fun, what you think?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|