cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
compile error
compile error
Nov 8, 2013 at 9:07am UTC
hkhoshraftar
(1)
this code has an
error
// a is an object with an string called name
printf("%s",a.nmae);
Nov 8, 2013 at 9:18am UTC
coder777
(8439)
ok: nmae is not name. next?
Nov 8, 2013 at 9:21am UTC
duky
(18)
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.