compile error

this code has an error
// a is an object with an string called name
printf("%s",a.nmae);
ok: nmae is not name. next?
Assuming it's not a typo, then you're passing a std::string to printf() instead of a c string. http://www.cplusplus.com/reference/string/string/c_str/

Post the error message next time.
Topic archived. No new replies allowed.