C++ is more type-strict than C. C is allowing the pointer to be implicitly cast, whereas C++ sees that the types are not similar and gives you an error.
You can explicitly cast to get around the error:
1 2 3
strcpy((char*)p->data, text); // C-style cast
// or
strcpy( reinterpret_cast<char*>(p->data), text ); // C++ style cast