strcpy source is not displayed

 #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main ()
{
    char a[]="one string",b[]="twostrings";
     strcpy (a,b);

    cout<<"A="<<a;
    cout<<endl<<"B="<<b<<endl;
}

a and b are equal after displaying them ,but if I put a space like this b[]="two strings", and then cout b ,it shows b as blank,why?


Source: c++

Leave a Reply