Results 1 to 10 of 10

Thread: C++

  1. #1
    gibsonrocker800's Avatar
    gibsonrocker800 is offline Senior Member
    Join Date
    Nov 2007
    Location
    New York
    Posts
    143
    Rep Power
    0

    Default 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?

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default 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. :D
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    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 ;)

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    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.

  5. #5
    gibsonrocker800's Avatar
    gibsonrocker800 is offline Senior Member
    Join Date
    Nov 2007
    Location
    New York
    Posts
    143
    Rep Power
    0

    Default

    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.

  6. #6
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    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.

  7. #7
    gibsonrocker800's Avatar
    gibsonrocker800 is offline Senior Member
    Join Date
    Nov 2007
    Location
    New York
    Posts
    143
    Rep Power
    0

    Default

    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.

  8. #8
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    I want to make something that has never been done before
    Try to make an Anti-Virus for PC in java....
    freedom exists in the world of ideas

  9. #9
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    7

    Default

    Try making a video game that is good in java, which is impossible (LOL JK). How about a bit torrent.

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •