0
// function declaration
    char* operator LPCTSTR();


// defenition
char* String::operator LPCTSTR()
{
       char* szArry = NULL;
       szArry[1024]; 
       reurn(szArry);  
}

how we can create a LPCTSTR string class member function in c++

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

LPCTSTR is typedef'ed in windows.h as const char* . So your String class will want to return a char* pointer to its character array, or whatever kind of data it holds.

class String
{
private:
   char* str;
public:
   const char* operator LPCTSTR()
   {
         return str;
   }
};
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.