previous | start | next

C Strings: Assignment

        char * strcpy(char *dest, const char *source);
     

The 'const' means something can't be changed. What is that something?

int main()
{
  char s[] = "Hello, World!";
  char m[50];

  strcpy(m, s);

  cout << m << endl;

}
Output: Hello, World!



previous | start | next