Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





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.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-29-2008, 08:14 AM
gibsonrocker800's Avatar
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
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?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-29-2008, 10:53 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-29-2008, 12:32 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-29-2008, 01:11 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,959
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-29-2008, 08:16 PM
gibsonrocker800's Avatar
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
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?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 01-29-2008, 08:29 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 01-29-2008, 08:32 PM
gibsonrocker800's Avatar
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
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?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 04-24-2008, 05:31 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Quote:
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.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 04-25-2008, 06:18 AM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
Try making a video game that is good in java, which is impossible (LOL JK). How about a bit torrent.
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 04-25-2008, 06:24 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,959
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
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

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



All times are GMT +3. The time now is 11:09 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org