Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help me debug this pls Pin
GDavy26-Jul-05 1:57
GDavy26-Jul-05 1:57 
GeneralRe: help me debug this pls Pin
Mike Dimmick26-Jul-05 2:43
Mike Dimmick26-Jul-05 2:43 
Questionhow to................. Pin
Member 214683925-Jul-05 23:27
Member 214683925-Jul-05 23:27 
AnswerRe: how to................. Pin
David Crow26-Jul-05 2:50
David Crow26-Jul-05 2:50 
AnswerRe: how to................. Pin
Member 214683926-Jul-05 4:59
Member 214683926-Jul-05 4:59 
Generaltapi 2.2 lineMonitorTones Pin
nripun25-Jul-05 22:53
nripun25-Jul-05 22:53 
GeneralUse of string in switch case Pin
itkid25-Jul-05 22:53
itkid25-Jul-05 22:53 
GeneralRe: Use of string in switch case Pin
berndg25-Jul-05 23:56
berndg25-Jul-05 23:56 
I can only guess and believe you might want to do something like this:

<br />
switch (myString) {<br />
   case "Blue":<br />
      ...<br />
      break;<br />
   case "Red":<br />
      ...<br />
      break;<br />
   ...<br />
}<br />


Trouble is, the C or C++ languages don't do that. C# does. Thus, one solution is to use C#. If you want to use C/C++, you must use nested if/else clauses to emulate the same effect, something like so:

<br />
if (_tcsicmp(myString, _T("blue")) == 0) {<br />
   ...<br />
} else if (_tcsicmp(myString, _T("red")) == 0) {<br />
   ...<br />
...<br />
}<br />


Doesn't look as nice, but, compared to the above fictivious switch statement, gives you control over the comparison algorithm (e.g. use _tcsicmp for case-insensitive comparison, or _tcscmp for case-sensitive comparison), etc.
GeneralRe: Use of string in switch case Pin
Iain Clarke, Warrior Programmer26-Jul-05 0:23
Iain Clarke, Warrior Programmer26-Jul-05 0:23 
GeneralRe: Use of string in switch case Pin
berndg26-Jul-05 4:18
berndg26-Jul-05 4:18 
GeneralRe: Use of string in switch case Pin
markkuk26-Jul-05 12:09
markkuk26-Jul-05 12:09 
GeneralRe: Use of string in switch case Pin
itkid27-Jul-05 2:31
itkid27-Jul-05 2:31 
QuestionHow to monitor a file's actions? Pin
wood25-Jul-05 22:52
wood25-Jul-05 22:52 
AnswerRe: How to monitor a file's actions? Pin
David Crow26-Jul-05 2:57
David Crow26-Jul-05 2:57 
GeneralSorry,my explanation isn't clear! Pin
wood26-Jul-05 15:36
wood26-Jul-05 15:36 
GeneralRe: Sorry,my explanation isn't clear! Pin
David Crow27-Jul-05 2:42
David Crow27-Jul-05 2:42 
Generalsetting Timeout ..Please help me out Pin
Smith#25-Jul-05 22:51
Smith#25-Jul-05 22:51 
GeneralRe: setting Timeout ..Please help me out Pin
Marc Soleda25-Jul-05 23:31
Marc Soleda25-Jul-05 23:31 
GeneralRe: setting Timeout ..Please help me out Pin
Smith#26-Jul-05 1:12
Smith#26-Jul-05 1:12 
GeneralRe: setting Timeout ..Please help me out Pin
Smith#26-Jul-05 1:17
Smith#26-Jul-05 1:17 
GeneralRe: setting Timeout ..Please help me out Pin
Marc Soleda26-Jul-05 1:21
Marc Soleda26-Jul-05 1:21 
GeneralRe: setting Timeout ..Please help me out Pin
Smith#26-Jul-05 1:24
Smith#26-Jul-05 1:24 
GeneralRe: setting Timeout ..Please help me out Pin
Marc Soleda26-Jul-05 1:34
Marc Soleda26-Jul-05 1:34 
GeneralRe: setting Timeout ..Please help me out Pin
David Crow26-Jul-05 3:06
David Crow26-Jul-05 3:06 
GeneralXML parsing using C++ Pin
72arpita25-Jul-05 22:47
72arpita25-Jul-05 22:47 

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.