Question on character string
Dear Sir or Madam:
What I have learned in school is when dealing with character string(char array)
we need to use strcpy() function, but I wonder why doing arithmetic assignment
on char string works fine without error or illegal syntax such as following code:
Can any C++ experts out there help to explain why? I think if character string assigment works Ok then I don't have to include the string.h that might causing overhead.
void SetMessage(char *msg)
m_message = msg; // instead of using strcpy(m_message, msg)
char * GetMessage()
char * m_message;
char *message = "Hello there";
cout << "Message name: " << FunChat.GetMessage();
Thank you very much for your help.