Click here to Skip to main content
15,888,321 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: user input in win32 application Pin
prasad_som25-Dec-06 18:40
prasad_som25-Dec-06 18:40 
AnswerRe: user input in win32 application Pin
ooolz25-Dec-06 18:46
ooolz25-Dec-06 18:46 
QuestionRe: user input in win32 application Pin
prasad_som25-Dec-06 18:56
prasad_som25-Dec-06 18:56 
Questionlittle dictionary Pin
rockfanskid25-Dec-06 16:44
rockfanskid25-Dec-06 16:44 
AnswerRe: little dictionary Pin
Hamid_RT26-Dec-06 7:06
Hamid_RT26-Dec-06 7:06 
QuestionMFC v.s. valarray Pin
ytod25-Dec-06 15:37
ytod25-Dec-06 15:37 
AnswerRe: MFC v.s. valarray Pin
prasad_som25-Dec-06 18:38
prasad_som25-Dec-06 18:38 
QuestionTemplates Pin
Astricks25-Dec-06 6:24
Astricks25-Dec-06 6:24 
I'm finding templates a bit hard to understand. I do understand some simple ones, but not everything. I looked at a sample program that finds max of two numbers and returns the bigger number. People say templates are generic but why not it take std::string into the function that finds of Max of two types(now it takes only numbers) We know that it's not sane to try "<" between strings but how does the compiler find the passed values are strings and reject it? and btw, how an STL container gets in anything we push? may it be numbers or strings, for example a vector. Can someone make a simple template program that just "holds" Object of any type, I just want to break the template barrier.
<br />
Box <int> box_int; box_int.hold(1);<br />
Box <std::string> box_str; box_str.hold("Astricks");<br />
Box <myClass> box_obj; box_obj.hold(myObj);<br />

Any help? Plz note: It's not a homework or assignement.
AnswerRe: Templates Pin
markkuk25-Dec-06 10:12
markkuk25-Dec-06 10:12 
AnswerRe: Templates Pin
peterchen25-Dec-06 10:25
peterchen25-Dec-06 10:25 
GeneralRe: Templates Pin
Astricks25-Dec-06 19:04
Astricks25-Dec-06 19:04 
GeneralRe: Thanks, But another question, Pin
Astricks26-Dec-06 2:27
Astricks26-Dec-06 2:27 
GeneralRe: Thanks, But another question, Pin
peterchen26-Dec-06 2:38
peterchen26-Dec-06 2:38 
GeneralRe: Thanks, But another question, Pin
Astricks26-Dec-06 2:46
Astricks26-Dec-06 2:46 
GeneralRe: Thanks, But another question, Pin
peterchen26-Dec-06 3:15
peterchen26-Dec-06 3:15 
GeneralRe: Thanks, But another question, Pin
Astricks26-Dec-06 5:27
Astricks26-Dec-06 5:27 
QuestionWeird C4244 warning message Pin
Cristian Amarie25-Dec-06 5:24
Cristian Amarie25-Dec-06 5:24 
AnswerRe: Weird C4244 warning message Pin
Mark Salsbery25-Dec-06 6:32
Mark Salsbery25-Dec-06 6:32 
GeneralRe: Weird C4244 warning message Pin
Cristian Amarie25-Dec-06 7:16
Cristian Amarie25-Dec-06 7:16 
GeneralRe: Weird C4244 warning message Pin
Mark Salsbery25-Dec-06 10:08
Mark Salsbery25-Dec-06 10:08 
GeneralRe: Weird C4244 warning message Pin
Cristian Amarie25-Dec-06 19:39
Cristian Amarie25-Dec-06 19:39 
GeneralRe: Weird C4244 warning message Pin
Mark Salsbery26-Dec-06 5:18
Mark Salsbery26-Dec-06 5:18 
GeneralRe: Weird C4244 warning message Pin
Cristian Amarie26-Dec-06 6:12
Cristian Amarie26-Dec-06 6:12 
GeneralRe: Weird C4244 warning message Pin
prasad_som25-Dec-06 22:06
prasad_som25-Dec-06 22:06 
QuestionSubtracting times - need a result including milliseconds Pin
SWDevil25-Dec-06 5:11
SWDevil25-Dec-06 5:11 

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.