The output of the following program heavily depends on your architecture:
# include <stdio.h> # include <iostream> # include <time.h> using namespace std; size_t getPtrSize( char *ptr ) { return sizeof( ptr ); } int main() { time_t lt; lt = time(NULL); cout << "Date: " << ctime(<) << endl; cout << "\nThe length of " << ctime(<) << " is: " << sizeof ctime(<) << "\nThe size of the pointer is " << getPtrSize( ctime(<) ) << endl; cout << " or " << sizeof(time_t); return 0; }
The output is as follows:
The length of Tue Dec 27 01:43:42 2016
is: 8
The size of the pointer is 8
or 8