Click here to Skip to main content
15,033,303 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to perform Expression Evaluation Pin
Sascha Lefèvre17-Mar-16 10:52
professionalSascha Lefèvre17-Mar-16 10:52 
AnswerRe: How to perform Expression Evaluation Pin
Chris Losinger17-Mar-16 12:33
professionalChris Losinger17-Mar-16 12:33 
GeneralRe: How to perform Expression Evaluation Pin
Patrice T17-Mar-16 13:11
mvePatrice T17-Mar-16 13:11 
AnswerRe: How to perform Expression Evaluation Pin
Patrice T17-Mar-16 13:09
mvePatrice T17-Mar-16 13:09 
AnswerRe: How to perform Expression Evaluation Pin
Bram van Kampen22-Mar-16 14:16
MemberBram van Kampen22-Mar-16 14:16 
GeneralRe: How to perform Expression Evaluation Pin
David Crow23-Mar-16 2:28
MemberDavid Crow23-Mar-16 2:28 
GeneralRe: How to perform Expression Evaluation Pin
Bram van Kampen25-Mar-16 13:11
MemberBram van Kampen25-Mar-16 13:11 
AnswerRe: How to perform Expression Evaluation Pin
Alan Balkany8-Apr-16 6:53
MemberAlan Balkany8-Apr-16 6:53 
The "official" way to do expression evaluation involves parse trees and reverse Polish notation, but I found a simpler more practical approach: Repeatedly process your list of tokens, making it one step simpler each time by applying a series of rules:

1. If you see the sequence '(', 'number', ')', replace it with just 'number'.
2. For each operator in decreasing precedence, look for the sequence 'number', 'operator', 'number' and replace it with the result of the operation.

If you end up with a single number, that's your answer. Anything else indicates a syntax error in the input expression.
QuestionVagarities of Multiple threads in Windows Pin
Bram van Kampen16-Mar-16 14:36
MemberBram van Kampen16-Mar-16 14:36 
AnswerRe: Vagarities of Multiple threads in Windows Pin
Jochen Arndt16-Mar-16 21:59
professionalJochen Arndt16-Mar-16 21:59 
AnswerRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan16-Mar-16 23:05
mveRichard MacCutchan16-Mar-16 23:05 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen17-Mar-16 16:30
MemberBram van Kampen17-Mar-16 16:30 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan17-Mar-16 22:51
mveRichard MacCutchan17-Mar-16 22:51 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen18-Mar-16 17:57
MemberBram van Kampen18-Mar-16 17:57 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan18-Mar-16 22:57
mveRichard MacCutchan18-Mar-16 22:57 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen19-Mar-16 13:41
MemberBram van Kampen19-Mar-16 13:41 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Richard MacCutchan19-Mar-16 22:09
mveRichard MacCutchan19-Mar-16 22:09 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen22-Mar-16 13:34
MemberBram van Kampen22-Mar-16 13:34 
AnswerRe: Vagarities of Multiple threads in Windows Pin
leon de boer19-Mar-16 21:35
Memberleon de boer19-Mar-16 21:35 
GeneralRe: Vagarities of Multiple threads in Windows Pin
Bram van Kampen22-Mar-16 13:33
MemberBram van Kampen22-Mar-16 13:33 
GeneralRe: Vagarities of Multiple threads in Windows Pin
leon de boer25-Mar-16 23:57
Memberleon de boer25-Mar-16 23:57 
QuestionOpenGL control on split MFC form Pin
Member 1228273814-Mar-16 10:08
MemberMember 1228273814-Mar-16 10:08 
AnswerRe: OpenGL control on split MFC form Pin
Richard MacCutchan14-Mar-16 23:48
mveRichard MacCutchan14-Mar-16 23:48 
QuestionDefault argument for DISP_FUNCTION_ID Pin
Member 1214953910-Mar-16 16:44
MemberMember 1214953910-Mar-16 16:44 
AnswerRe: Default argument for DISP_FUNCTION_ID Pin
Bram van Kampen16-Mar-16 15:45
MemberBram van Kampen16-Mar-16 15:45 

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.