convert C to C++

So how do I convert these few lines to C++?


char *str = new char[amp.length()+1];
strcpy (strr, amp.c_str());

------------------------------------------
if (pch && pch1)

{
cout << array[index] << endl;
}
1
2
3
4
5
6
std::string str = amp;

if ( pch && pch1 ) 
{
   std::cout << array[index] << std::endl;
}
These lines are already written in C++, not in C.
amp is already a std::string, you have used new operator, etc
Thanks.
Topic archived. No new replies allowed.