Click here to Skip to main content
15,879,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 11:41
Allad28-Jan-06 11:41 
AnswerRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 1:15
Stephen Hewitt28-Jan-06 1:15 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 11:33
Allad28-Jan-06 11:33 
GeneralRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 18:12
Stephen Hewitt28-Jan-06 18:12 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 18:23
Allad28-Jan-06 18:23 
GeneralRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 18:35
Stephen Hewitt28-Jan-06 18:35 
QuestionMoving the hole Pin
eivanlo27-Jan-06 7:20
eivanlo27-Jan-06 7:20 
AnswerRe: Moving the hole Pin
Bob Ciora27-Jan-06 12:03
Bob Ciora27-Jan-06 12:03 
I'm not sure what you're doing with phole, but it's being assigned the same value in every case of the switch statement. This is inefficient. Most of all, though, you don't need phole at all.

In addition, you don't need tar_row and tar_col either. Your switch statement can simply increment or decrement hrow and/or hcol directly. When you're finished, just convert these values back into holeidx.

You can stop here. This will solve your problem. Also...

You can remove the switch statement altogether and use a lookup table. Translate the '1' through '9' values into an index into this table. Table entries would be simple structs holding the modification to the row and column variables. You only need special traps for the 'q' key.

This table could be simplified even further by storing the modifier to holeidx. But this table would have to be built at run-time, since the value of size isn't known until then.



Bob Ciora

-- modified at 18:04 Friday 27th January, 2006
QuestionHow do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster27-Jan-06 7:12
Swinefeaster27-Jan-06 7:12 
AnswerRe: How do you get Vc6 apps to look themed in Vc8? Pin
Jack Puppy27-Jan-06 8:37
Jack Puppy27-Jan-06 8:37 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster27-Jan-06 10:44
Swinefeaster27-Jan-06 10:44 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Jack Puppy27-Jan-06 13:25
Jack Puppy27-Jan-06 13:25 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Prakash Nadar27-Jan-06 22:37
Prakash Nadar27-Jan-06 22:37 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster3-Feb-06 8:10
Swinefeaster3-Feb-06 8:10 
QuestionHow to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 5:27
sysop@HAL9K.com27-Jan-06 5:27 
AnswerRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:20
Toby Opferman27-Jan-06 7:20 
GeneralRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:39
Toby Opferman27-Jan-06 7:39 
AnswerRe: How to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 9:24
sysop@HAL9K.com27-Jan-06 9:24 
AnswerRe: How to find total memory a process is using? Pin
David Crow27-Jan-06 9:39
David Crow27-Jan-06 9:39 
Question"choose color" combobox Pin
xyhan27-Jan-06 5:24
xyhan27-Jan-06 5:24 
AnswerRe: "choose color" combobox Pin
Graham Bradshaw27-Jan-06 5:36
Graham Bradshaw27-Jan-06 5:36 
AnswerRe: "choose color" combobox Pin
David Crow27-Jan-06 9:41
David Crow27-Jan-06 9:41 
Questionhttp://www.codeproject.com/listctrl/liwne.asp Pin
hanno2527-Jan-06 4:48
hanno2527-Jan-06 4:48 
AnswerRe: http://www.codeproject.com/listctrl/liwne.asp Pin
benjymous27-Jan-06 5:41
benjymous27-Jan-06 5:41 
QuestionInheritance question Pin
act_x27-Jan-06 4:39
act_x27-Jan-06 4:39 

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.