This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/cplbexam/string/pubfun/cstr.cpp

15 lines
370 B
C++

#include <string.hpp>
void main( void ) {
String s ("Open Watcom C++");
char const *pch1, *pch2;
pch1 = s.operator char const *(); // S1
pch2 = ( const char * )s; // S2
// S1 and S2 are the same
cout << "The first string is \"" << pch1 << "\"" << endl;
cout << "The other string is \"" << pch2 << "\"" << endl;
}