Click here to Skip to main content
15,895,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: File Compare Pin
SilentSilent20-Dec-05 0:09
SilentSilent20-Dec-05 0:09 
AnswerRe: File Compare Pin
ThatsAlok20-Dec-05 0:48
ThatsAlok20-Dec-05 0:48 
QuestionEdit Box input problem Pin
nripun19-Dec-05 20:48
nripun19-Dec-05 20:48 
AnswerRe: Edit Box input problem Pin
ThatsAlok19-Dec-05 21:36
ThatsAlok19-Dec-05 21:36 
QuestionTemplate class and const parameters Pin
Nishad S19-Dec-05 20:47
Nishad S19-Dec-05 20:47 
AnswerRe: Template class and const parameters Pin
vikas amin19-Dec-05 23:24
vikas amin19-Dec-05 23:24 
GeneralRe: Template class and const parameters Pin
Nishad S20-Dec-05 0:01
Nishad S20-Dec-05 0:01 
GeneralRe: Template class and const parameters Pin
vikas amin20-Dec-05 0:19
vikas amin20-Dec-05 0:19 
<br />
template < typename   T > class DataList<br />
{<br />
 public:<br />
AddNode(const T val) // Input data must be read only<br />
{<br />
  // some codes<br />
  // val="v";<br />
}<br />
  // some more functions<br />
};<br />
<br />
<br />
IN Main function <br />
<br />
LPCSTR str = "Hello";  // Const char string<br />
DataList< char *> data; // Data list for char strings<br />
data.AddNode((char*)str);     // Add the string<br />



the above code satisfies your demand , i just type casted the LPCSTR to char *
and to access the AddNode declared it with Public scope .
If u want to check just try changing the { val="v";} u will see an compiler
error for constant.


//////////////////////////////////////////////////////////////////////

Cool | :cool:

Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
GeneralRe: Template class and const parameters Pin
Nishad S20-Dec-05 0:29
Nishad S20-Dec-05 0:29 
GeneralRe: Template class and const parameters Pin
vikas amin20-Dec-05 1:31
vikas amin20-Dec-05 1:31 
GeneralRe: Template class and const parameters Pin
Nishad S20-Dec-05 1:43
Nishad S20-Dec-05 1:43 
AnswerRe: Template class and const parameters Pin
Zdeslav Vojkovic20-Dec-05 0:05
Zdeslav Vojkovic20-Dec-05 0:05 
AnswerRe: Template class and const parameters Pin
khan++20-Dec-05 0:31
khan++20-Dec-05 0:31 
QuestionHow to include dlls in VC++.NET application. Pin
snprani19-Dec-05 20:34
snprani19-Dec-05 20:34 
Questionsaving locations of ActiveX in application Pin
Sac87Rak19-Dec-05 20:23
Sac87Rak19-Dec-05 20:23 
QuestionGetting Problem when using NetMeeting SDK Pin
trinadh_t19-Dec-05 20:09
trinadh_t19-Dec-05 20:09 
QuestionNeed help Pin
coolsab19-Dec-05 20:09
coolsab19-Dec-05 20:09 
AnswerRe: Need help Pin
ThatsAlok19-Dec-05 21:33
ThatsAlok19-Dec-05 21:33 
AnswerRe: Need help Pin
vikas amin19-Dec-05 22:59
vikas amin19-Dec-05 22:59 
Questionindex server catalogs Pin
akshayswaroop19-Dec-05 19:33
akshayswaroop19-Dec-05 19:33 
QuestionAbout termintaing System processes.. Pin
Supriya Tonape19-Dec-05 19:30
Supriya Tonape19-Dec-05 19:30 
AnswerRe: About termintaing System processes.. Pin
kakan19-Dec-05 21:19
professionalkakan19-Dec-05 21:19 
GeneralRe: About termintaing System processes.. Pin
Supriya Tonape20-Dec-05 21:56
Supriya Tonape20-Dec-05 21:56 
AnswerRe: About termintaing System processes.. Pin
ThatsAlok19-Dec-05 21:26
ThatsAlok19-Dec-05 21:26 
GeneralRe: About termintaing System processes.. Pin
Supriya Tonape20-Dec-05 22:03
Supriya Tonape20-Dec-05 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.