I’m trying to get “CMtoaPlugin::listArnoldNodes()” to return an “array” of strings
std::vector<std::string> ArnoldNodes = CMtoaPlugin::listArnoldNodes();
std::vector<std::string>::iterator it;
for ( it=ArnoldNodes.begin() ; it < ArnoldNodes.end(); it++ )
{
printf("initialize shader %s\n", *it);
}
but this is what i get, 2 entries, that’s correct but the content of the entry is not
initialize Arnold shader †¡/
initialize Arnold shader.
what am i doing wrong
Try it like this:
printfdoesn’t work withstd::string, you need to usecout(or pass itit->c_str())it != vec.end()(since you only need to check for equality, not compare), and++itto increment (post-increment can be less efficient for some iterators).