FindNextFile()
PathFindExtension()
This is a blog about my learning C++. I have been working with C++ for years, but have come to the conclusion that I really know much less than I would like. I am trying to capture what I learn and what resources I use in learning. It is strange that after working with it for so many years there is still so much I don't know.
http://msdn.microsoft.com/en-us/library/ms724950(VS.85).aspx
typedef struct _SYSTEMTIME { WORD wYear; WORD wMonth; WORD wDayOfWeek; WORD wDay; WORD wHour; WORD wMinute; WORD wSecond; WORD wMilliseconds; } SYSTEMTIME, *PSYSTEMTIME;
|
3.14159L // long double 6.02e23f // float
'z' 'p' "Hello world" "How do you do?"
\n
newline \r
carriage return \t
tab \v
vertical tab \b
backspace \f
form feed (page feed) \a
alert (beep) \'
single quote (') \"
double quote (") \?
question mark (?) \\
backslash (\)
For example:
1
2
3
4
'\n' '\t' "Left \t Right" "one\ntwo\nthree"
More at link.
double fmod ( double numerator, double denominator ); float fmod ( float numerator, float denominator ); long double fmod ( long double numerator, long double denominator );
COleDateTime( ) throw( ); COleDateTime( const VARIANT& varSrc ) throw( ); COleDateTime( DATE dtSrc ) throw( ); COleDateTime( time_t timeSrc ) throw( ); COleDateTime( __time64_t timeSrc ) throw( ); COleDateTime( const SYSTEMTIME& systimeSrc ) throw( ); COleDateTime( const FILETIME& filetimeSrc ) throw( ); COleDateTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec ) throw( ); COleDateTime( WORD wDosDate, WORD wDosTime ) throw( ); COleDateTime( const DBTIMESTAMP& dbts ) throw();
http://msdn.microsoft.com/en-us/library/c3zzz087(v=VS.80).aspx
Function for getting the DBTIMESTAMP.
bool GetAsDBTIMESTAMP( DBTIMESTAMP& dbts ) const throw();
The fraction time is from 0 to 999,999,999.Not really sure what good this does since you can only get it for the current time and any translation of time rounds to the nearest second.DBTIMESTAMPThe DBTIMESTAMP structure typedef is defined as follows:
typedef struct tagDBTIMESTAMP { SHORT year; USHORT month; USHORT day; USHORT hour; USHORT minute; USHORT second; ULONG fraction } DBTIMESTAMP;Members
- year
- The year (0 to 9999) is measured from 0 A.D.
- month
- The month ranges from 1 to 12 representing January through December.
- day
- The day ranges from 1 to a maximum of 31, depending on the number of days in the month.
- hour
- The hour ranges from 0 to 23.
- minute
- The minute ranges from 0 to 59.
- second
- The second ranges from 0 to 59.
- fraction
- The fraction represents billionths of a second ranging from 0 to 999,999,999.
The DBTIMESTAMP structure typedef is defined as follows:
typedef struct tagDBTIMESTAMP { SHORT year; USHORT month; USHORT day; USHORT hour; USHORT minute; USHORT second; ULONG fraction } DBTIMESTAMP;
Members
The time structure is has greater resolution:'yyyy-mm-dd hh:mm:ss[.999]
'hh:mm:ss[.9999999]
class C { static int i; static int j; static int k; static int l; static int m; static int n; static int p; static int q; static int r; static int s; static int f() { return 0; } int a; public: C() { a = 0; } };
C c; int C::i = C::f(); // initialize with static member function int C::j = C::i; // initialize with another static data member int C::k = c.f(); // initialize with member function from an object int C::l = c.j; // initialize with data member from an object int C::s = c.a; // initialize with nonstatic data member int C::r = 1; // initialize with a constant value
class Y : private C {} y; int C::m = Y::f(); int C::n = Y::r; int C::p = y.r; // error int C::q = y.f(); // error
Can the error be managed?Yes - throw exception and handle it.No - use assert.
Can you write a unit test that is able to throw the exception?Exception example:
Yes - exception
No - assert
Are you protecting against a coding error?
Yes - assert
No - exception
Are you protecting against 'normal program' (i.e. file not writable etc.):
Yes - exception
No - assert
try { throw CSomeOtherException(); } catch(...) { // Handle all exceptions // Respond (perhaps only partially) to exception throw; // Pass exception to some other handler }