It shouldn't be a general problem, the following program runs fine.
Make sure the pointer you receive contains what you want it to
hold. Using assertions like above is a good method for verifying that.


PHP Code:
#include <string.h>
#include <string>
#include <iostream>

using namespace std;

string test( const chartocopy )
{
    
string s tocopy;

    if( 
strcmps.c_str(), tocopy ) != )
    {
        
cout << s;
    }

    return 
s;
}


int main()
{
    
char szBuffer[1000];

    
memsetszBuffer0999 );
    
memsetszBuffer'A'900 );

    
charpc szBuffer;

    
string str testpc );

    if( 
strcmpstr.c_str(), pc ) != )
    {
        
cout << str;
    }

    
cout << endl << "the end. no errors.";

    return 
0;