I'm trying to learn some c++ and it is sometimes very frustrating :(
Can somebody help me to explain whats wrong with the line "cout << p
<< endl;", since it does't print anything. Everything else works as
expected. Thanks :)
#include "stdafx.h"
#include <iostream>
#include <bitset>
using namespace std;
int x;
int _tmain(int argc, _TCHAR* argv[])
{
bitset<12> bs(64);
const char* p = bs.to_string().c_str();
const char* c = "kakespade";
cout << bs.to_string() << endl;
cout << bs.to_string().c_str() << endl;
cout << p << endl;
cout << c << endl;
cin >> x;
return 0;
}