Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerOfftopic Pin
Jörgen Sigvardsson23-Sep-05 0:30
Jörgen Sigvardsson23-Sep-05 0:30 
GeneralRe: Offtopic Pin
Themis23-Sep-05 2:47
Themis23-Sep-05 2:47 
QuestionLinker Error Pin
rajeevktripathi22-Sep-05 23:43
rajeevktripathi22-Sep-05 23:43 
AnswerRe: Linker Error Pin
ThatsAlok23-Sep-05 0:05
ThatsAlok23-Sep-05 0:05 
AnswerRe: Linker Error Pin
MailtoGops23-Sep-05 0:11
MailtoGops23-Sep-05 0:11 
QuestionProgram Deployment Pin
mikobi22-Sep-05 23:19
mikobi22-Sep-05 23:19 
AnswerRe: Program Deployment Pin
Mircea Puiu23-Sep-05 2:52
Mircea Puiu23-Sep-05 2:52 
Questioninitialize stl map in static scope Pin
yccheok22-Sep-05 23:10
yccheok22-Sep-05 23:10 
for primitive data type, i am able to initialize them in static scope:

class x {
public:
static int var[];
};

/* We are able to have var initialize before x object being instance. */
int x::var[] = {1, 2, 3};


However, for a stl map, how i can have elements inserted into it in static scope too?

class x {
private:
static map<int, int=""> var;
};

/* The below code will generate compile error. */
/* I wish to have elements to be inserted into map before x is instanced. How I can do so? */
map<int, int=""> x::map = {
{1, 2},
{3, 4}
};

Thanks!

cheok

-- modified at 5:11 Friday 23rd September, 2005
AnswerRe: initialize stl map in static scope Pin
toxcct22-Sep-05 23:22
toxcct22-Sep-05 23:22 
GeneralRe: initialize stl map in static scope Pin
Cedric Moonen22-Sep-05 23:46
Cedric Moonen22-Sep-05 23:46 
GeneralRe: initialize stl map in static scope Pin
toxcct22-Sep-05 23:52
toxcct22-Sep-05 23:52 
GeneralRe: initialize stl map in static scope Pin
yccheok23-Sep-05 1:28
yccheok23-Sep-05 1:28 
GeneralRe: initialize stl map in static scope Pin
Laffis23-Sep-05 1:06
Laffis23-Sep-05 1:06 
GeneralRe: initialize stl map in static scope Pin
yccheok23-Sep-05 1:19
yccheok23-Sep-05 1:19 
AnswerRe: initialize stl map in static scope Pin
Tim Smith23-Sep-05 3:58
Tim Smith23-Sep-05 3:58 
AnswerRe: pointer to char array Pin
Eytukan22-Sep-05 23:02
Eytukan22-Sep-05 23:02 
GeneralRe: pointer to char array Pin
sunit523-Sep-05 2:56
sunit523-Sep-05 2:56 
GeneralRe: pointer to char array Pin
ThatsAlok23-Sep-05 17:53
ThatsAlok23-Sep-05 17:53 
AnswerRe: pointer to char array Pin
FarPointer23-Sep-05 1:22
FarPointer23-Sep-05 1:22 
QuestionA very urgent problem Pin
momer22-Sep-05 22:17
momer22-Sep-05 22:17 
QuestionCryptEncrypt and CryptDecrypt functions of CryptoApi problems Pin
naeemnimi22-Sep-05 21:49
naeemnimi22-Sep-05 21:49 
AnswerRe: CryptEncrypt and CryptDecrypt functions of CryptoApi problems Pin
Elmue6-Sep-10 9:51
Elmue6-Sep-10 9:51 
Questioni need help to fix the histogram.plz Pin
davidcooler22-Sep-05 21:26
davidcooler22-Sep-05 21:26 
JokeRe: i need help to fix the histogram.plz Pin
khan++22-Sep-05 21:43
khan++22-Sep-05 21:43 
GeneralRe: i need help to fix the histogram.plz Pin
David Crow23-Sep-05 3:46
David Crow23-Sep-05 3:46 

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.