titi wrote:
[color=blue]
> Hi! How to right the C++ program that initialize the name with null
> value and with some specific string?[/color]
How can one initialize a string with two values, NULL and a
a specific string?
#include <string>
#include <iostream>
using std::string;
using std::cout;
using std::endl;
string name_not_const("name not const");
string null_name;
const string const_name("constant name");
int main(void)
{
cout << '"' << name_not_const << '"' << '\n';
cout << '"' << null_name << '"' << '\n';
cout << '"' << const_name << '"' << endl;
return 0;
}
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book