Я использую Visual C++ для компиляции плагина -для Cinema 4D.
GeDebugOut("-->");
subroot = NULL;
head = NULL;
tail = NULL;
success = PolygonizeHierarchy(source, hh, head, tail, &subroot, malloc);
if (!success) {
/*.. */
}
String str("not set.");
if (subroot) {
GeDebugOut("yes");
str = "yes!";
GeDebugOut("Subroot name: " + subroot->GetName());
}
else {
GeDebugOut("no");
str = "no!";
}
GeDebugOut("Is there a subroot? " + str);
GeDebugOut("<--");
Ожидаемый результат следующий:
-->
yes
Subroot name: Cube
Is there a subroot? yes
<--
(или то же самое с «нет» вместо этого. )Но я получаю
-->
yes
<--
Почему здесь не хватает двух отпечатков?
Это декларация GeDebugOut
.
void GeDebugOut(const CHAR* s, ...);
void GeDebugOut(const String& s);
Класс String
является конкатенируемым. Он перегружает оператор +
.
String(void);
String(const String& cs);
String(const UWORD* s);
String(const CHAR* cstr, STRINGENCODING type = STRINGENCODING_XBIT);
String(LONG count, UWORD fillch);
friend const String operator +(const String& Str1, const String& Str2);
const String& operator +=(const String& Str);