There are two way to define a character array constant:
1. const char* const OUT_STRING="hello world";
2.const string OUT_STRING="hello world";
which one is better? why?

> which one is better?
usually const char* const OUT_STRING = "hello world" ; > why?
more efficient.
exception: you need to pass it often to functions which expect a const std::string&

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.