Actually, there's still a problem with it; the formatting string is incorrect, which means that the time string never gets created. The correct format should be "%I"
for hours (12-hour format) and "%M"
for minutes.
Try the following:
#include <iostream>
#include <cstdio>
#include <ctime>
using namespace std;
const int Buffer_Size = 32;
int main()
{
time_t rawtime;
struct tm * timeinfo;
char space[Buffer_Size];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(space, Buffer_Size,"Current Time: %I:%M %p",timeinfo);
cout << space << endl;
return 0;
}