Home > Software engineering >  Cstrings output problem
Cstrings output problem

Time:10-27

Cstrings A (" ABC ");
cout <(LPCTSTR) A;
The output of A why not ABC but A string of 00 f61898
Is there a way to make the output character of ABC

CodePudding user response:

cout < (LPCTSTR) A;//red gild the lily, to join the red, turned into A pointer, the pointer is as numerical processing

CodePudding user response:

cout <(LPCTSTR) A;
Change
AfxDump & lt; CodePudding user response:

Using cstrings A

 
Int main ()
{
CStringA A (" ABC ");
cout return 0;
}


Or

 
Int main ()
{
Cstrings A (" ABC ");
cout <(CStringA) A;
return 0;
}
  • Related