1) Yes, you use public: and list everything
2) You shouldn't get an error. You can define the method in a normal class. There are some issues though. Does that method (function) uses objects from another class? If so you have to check forward declaration and stuff which don't exist (hopefully) in C#. In any case it won't be defined globally, you would probably need the :: scope symbol. Like class::method. Post certain code for more clarifications.
4) In C++ this is an object:
the same way you declare a variable. You can use a constructor like:
the new keyword dynamically allocates memory.
In C# this is a reference and not an object:
the equivalent thing in C++ is this for a reference:
Code:
object& O; //even though you would get an initialization error
Code:
object& O = new Object(a,b);
So, the new is dynamically allocation, without the new is statical allocation. In any way you will have allocated memory.
5) There should be certain functions that do that. I ll search and post some
A C++ way is:
Code:
std::stringstream ss;
int t = 123;
ss << t;
std::string str = ss.str();
The opposite:
Code:
std::istringstream ss;
std::string str = "2443"
int t;
ss >> t;
You can also use sprintf(), atoi() and other functions. Google and you will find many results.
For example I find this:
Code:
#include <boost/lexical_cast.hpp>
#include <string>
try
{
std::string text = "152";
int number = boost::lexical_cast< int >( text );
}
catch( const boost::bad_lexical_cast & )
{
//unable to convert
}