Click here to Skip to main content
16,005,206 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OCX to DLL Pin
toxcct1-May-07 23:30
toxcct1-May-07 23:30 
GeneralRe: OCX to DLL Pin
Nilesh Hapse1-May-07 23:31
Nilesh Hapse1-May-07 23:31 
AnswerRe: OCX to DLL Pin
prasad_som2-May-07 1:28
prasad_som2-May-07 1:28 
GeneralRe: OCX to DLL Pin
Nilesh Hapse2-May-07 21:04
Nilesh Hapse2-May-07 21:04 
QuestionHow to wait for a callback function? Pin
rumburack1-May-07 22:33
rumburack1-May-07 22:33 
AnswerRe: How to wait for a callback function? [modified] Pin
Moak1-May-07 23:43
Moak1-May-07 23:43 
Questiondrawing image histogram and change it by mouse Pin
ndadashi1-May-07 22:33
ndadashi1-May-07 22:33 
Questionhow to initialize const char array? Pin
Joe Smith IX1-May-07 22:21
Joe Smith IX1-May-07 22:21 
Hi,

The following is the example I have (and works):
const char *labels[] = {"Mon", "Tue", "Wed"}
SomeFunctions(labels, 3);

Now I want to initialize the contents of the array at run-time.
I tried the following but an error comes up:

const char *labels= NULL;
*labels = new char[3];
labels[0]=_T("Mon");
labels[1]=_T("Tue");
labels[2]=_T("Wed");
SomeFunctions(labels, 3);


error C2665: SomeFunctions : none of the 3 overloads can convert parameter 1 from type 'const char *'

Can someone please show me how declare the same type of array as the examples? Thanks.
AnswerRe: how to initialize const char array? Pin
Christian Graus1-May-07 22:30
protectorChristian Graus1-May-07 22:30 
GeneralRe: how to initialize const char array? Pin
Joe Smith IX1-May-07 22:37
Joe Smith IX1-May-07 22:37 
GeneralRe: how to initialize const char array? Pin
Christian Graus1-May-07 23:21
protectorChristian Graus1-May-07 23:21 
GeneralRe: how to initialize const char array? Pin
Joe Smith IX1-May-07 23:45
Joe Smith IX1-May-07 23:45 
AnswerRe: how to initialize const char array? [modified] Pin
toxcct1-May-07 22:32
toxcct1-May-07 22:32 
GeneralRe: how to initialize const char array? Pin
Joe Smith IX1-May-07 22:49
Joe Smith IX1-May-07 22:49 
GeneralRe: how to initialize const char array? Pin
toxcct1-May-07 22:54
toxcct1-May-07 22:54 
GeneralRe: how to initialize const char array? Pin
Joe Smith IX1-May-07 23:00
Joe Smith IX1-May-07 23:00 
QuestionPls help me Pin
prathuraj1-May-07 21:57
prathuraj1-May-07 21:57 
AnswerRe: Pls help me Pin
jk chan1-May-07 22:10
jk chan1-May-07 22:10 
GeneralRe: Pls help me Pin
prathuraj2-May-07 1:29
prathuraj2-May-07 1:29 
AnswerRe: Pls help me Pin
CPallini1-May-07 22:15
mveCPallini1-May-07 22:15 
QuestionCan anyone help Pin
josip cagalj1-May-07 21:44
josip cagalj1-May-07 21:44 
QuestionRe: Can anyone help Pin
Rajesh R Subramanian1-May-07 21:53
professionalRajesh R Subramanian1-May-07 21:53 
AnswerRe: Can anyone help Pin
josip cagalj1-May-07 22:06
josip cagalj1-May-07 22:06 
AnswerRe: Can anyone help Pin
Garth J Lancaster1-May-07 21:53
professionalGarth J Lancaster1-May-07 21:53 
AnswerRe: Can anyone help Pin
jk chan1-May-07 22:12
jk chan1-May-07 22:12 

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.