Używam Visual C++ do kompilowania mojej wtyczki do Cinema 4D.Dlaczego część mojego kodu nie jest wykonywana?
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("<--");
oczekiwany wynik jest następujący:
-->
yes
Subroot name: Cube
Is there a subroot? yes
<--
(. Lub to samo z "nie" zamiast) Ale mam
-->
yes
<--
Dlaczego są dwa odciski brakujące tutaj?
Jest to deklaracja GeDebugOut
.
void GeDebugOut(const CHAR* s, ...);
void GeDebugOut(const String& s);
Klasa String
jest konkatenowalna. Przeciąża operatora +
.
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);
W jaki sposób zadeklarowano "GeDebugOut"? – jxh
@ user315052 Zobacz moją edycję, pls. –
Czy 'String' jest typedef dla' std :: string'? – jxh