Page 1 of 1

Java to C++: Object class

Posted: Thu Apr 15, 2010 9:06 am
by Rui
I'm currently working with C++, and my background is Java, and some features from Java don't match in C++. For example, the Object class from Java which doesn't exist in C++.

If I have for example the following method in Java and want to port it to C++, what is the best approach?

Code: Select all

void Algorithm::setInputParameter(std::string name, Object object) { ..... }
Instead of Object use for example pointers to void? Templates?

Thanks

Re: Java to C++: Object class

Posted: Thu Apr 15, 2010 9:21 am
by gravaera
Hi,

http://stackoverflow.com/
http://cplusplus.com/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.horstmann.com/ccj2/ccjapp3.html
http://lmgtfy.com/?q=Introduction+to+C% ... rogramming

This forum is not a language help. There is a minimum par which you fail to meet. Please leave and learn how to program in a suitable language before returning.

Re: Java to C++: Object class

Posted: Thu Apr 15, 2010 9:52 am
by Rui
Sorry, my bad... I read "General Programming.. Programming, for all ages and all languages."

My mistake then..

Re: Java to C++: Object class

Posted: Thu Apr 15, 2010 9:54 am
by JamesM
Rui wrote:Sorry, my bad... I read "General Programming.. Programming, for all ages and all languages."

My mistake then..
... which is a subforum of "Osdev.org - the place to start for Operating System Developers". What it says on the tin.

There are better sites than this for your question.