Phollyer wrote: "so how do we concatenate these char* or convert a std::string into a char*?"
String handling in C++ is quite different from AppGameKit BASIC, and there are quite a number of ways of doing this. If you're just getting started with C++ though, I would consider using
stringstreams, as they're comparatively easy to get to grips with and less error prone than other options.
Phollyer wrote: "I often use Log(" Value of MY ==>"+str(MY)+"----------------------------------------------") which easily makes these entries stand out
is there some way to do this ion c++?"
In this specific example, there are actually two things you need to translate. The first problem you'll have is that AGK's Log function doesn't send its log messages to the Visual Studio output, so probably isn't very useful to you. Instead, if you're developing on Windows in Visual Studio, you'll probably want to use
OutputDebugString instead. Note that this will only work on Windows, so if you're targeting other platforms too, consider wrapping it in #ifdef _WIN32 ... #endif processor directives.
To put these two together into a working example, one way to translate your logging example into C++ would be something like this.
#include <sstream>
// ...
float MY = 5.0f;
std::stringstream message;
message << " Value of MY ==>" << MY << "----------------------------------------------\n";
OutputDebugString(message.str().c_str());
One thing it's important to bear in mind when working in AppGameKit Tier 2 is that when AppGameKit functions return a char * to you, you are responsible for freeing the memory, so it's very rarely going to be safe to use the result inline. Instead, you'll need to capture the pointer, use it wherever, and then delete it afterwards. Of course if it's just for debugging purposes, you may not care about memory leaks, but it's a good habit to get into.
Phollyer wrote: "in AGK1 I use a lot of constants like these
#Constant ColorBlue 0,0,255
#Constant ColorYellow 255,255,0
#Constant ColorOrange 255,165,0
then use the color constant in ant color setting...
is there a way to do this in AGK2?"
This one's easy in C++ (I'm assuming you mean Tier 2 here rather than AppGameKit 2). AppGameKit BASIC's #Constant is pretty much identical to C++'s #define, so just change the #Constant for #define and it should work.
Hope that helps.