i'm having trouble understaning this function call in the constructor.
( const char *const first, const char * const last )
i see we have a constant then a char type then a pointer to first thats declared a char constant. But isn't that declaring first a constant and a char twice. I'm reading Dietel 5th edition maybe i misread something can someone please explain this argument in the function call please to a newby.
Employee::Employee( const char * const first, const char * const last )
27 firstName = new char[ strlen( first ) + 1 ];
28 strcpy( firstName, first );
30 lastName = new char[ strlen( last ) + 1 ];
31 strcpy( lastName, last );
33 count++; // increment static count of employees
35 cout << "Employee constructor for " << firstName
36 << ' ' << lastName << " called." << endl;
37 } // end Employee constructor
here is a code snippet in Dietels 5th edition that i'm reading for my OOP class. I don't understand what the : x( value ) means in the constructor. The comment says initialize x to value, but can someone explain that to me in more detail please. I know its not inheritance because i haven't got to the chapter yet. Can some one please help. Here is the code snippet.
10 Test( int = 0 ); // default constructor
11 void print() const;
13 int x;
14 }; // end class Test
16 // constructor
17 Test::Test( int value )
18 : x( value ) // initialize x to value
20 // empty body
21 } // end constructor Test
Your attempting to pass a binary string to a function that expects a TCHAR string. You should convert it to some meaningful character string format first. The function will interpret the each byte of the binary value as char (char is a byte).
that gives the same error
but why am i only getting the first letter and not the whole value?
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs <--- thats what im tring to get