2 ms·
It does with newer compilers. Was some bugs with gcc and clang earlier. Try: #include <cstdio> template <class T = char> class string {
by rightbyte 7y ago
It does with newer compilers. Was some bugs with gcc and clang earlier.
Try:
#include <cstdio>
template <class T = char> class string
{
public:
string(const T *const c) : c_ptr(c){}
const T *const c_ptr;
};
int main()
{
string s = "qwe";
printf("%s", s.c_ptr);
return 0;
}