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

C / C++ / MFC

 
GeneralRe: Splitting Up Numbers Pin
Robert.C.Cartaino27-Aug-08 12:37
Robert.C.Cartaino27-Aug-08 12:37 
Stewie Griffin wrote:
You should think of an algorithm with the division ( / ) and mod ( % ) operators to split a number.


Yes, typically. But in this case, the program is prompting the user for the numbers so it is already in string form.

He can take the input string...
char[] n1 = "456";  /* or whatever the user enters */

...and "split the number" by accessing it character by character. Then covert each character to an int:
digit0 = n1[0] - '0';  /* or whatever conversion method you choose */
digit1 = n1[1] - '1';
/* etc. */

GeneralRe: Splitting Up Numbers Pin
David Crow28-Aug-08 4:04
David Crow28-Aug-08 4:04 
GeneralRe: Splitting Up Numbers Pin
Diagathon29-Aug-08 8:12
Diagathon29-Aug-08 8:12 
QuestionSmall usability issue with MFC Splitter window/ windows explorer style application Pin
Sternocera27-Aug-08 11:27
Sternocera27-Aug-08 11:27 
AnswerRe: Small usability issue with MFC Splitter window/ windows explorer style application Pin
led mike27-Aug-08 11:44
led mike27-Aug-08 11:44 
GeneralRe: Small usability issue with MFC Splitter window/ windows explorer style application Pin
Sternocera27-Aug-08 11:51
Sternocera27-Aug-08 11:51 
QuestionHow do I know the size of the char for ReadFile before reading the actual file. [modified] Pin
luisgrimaldo27-Aug-08 11:17
luisgrimaldo27-Aug-08 11:17 
AnswerRe: How do I know the size of the char for ReadFile before reading the actual file. Pin
led mike27-Aug-08 11:47
led mike27-Aug-08 11:47 
GeneralRe: How do I know the size of the char for ReadFile before reading the actual file. Pin
luisgrimaldo27-Aug-08 12:04
luisgrimaldo27-Aug-08 12:04 
GeneralRe: How do I know the size of the char for ReadFile before reading the actual file. Pin
David Crow28-Aug-08 4:06
David Crow28-Aug-08 4:06 
QuestionNeural Network Function Estimation Pin
Ehsan Baghaki27-Aug-08 10:07
Ehsan Baghaki27-Aug-08 10:07 
QuestionSetting menu item disabled state problem Pin
nick0122327-Aug-08 8:12
nick0122327-Aug-08 8:12 
QuestionRe: Setting menu item disabled state problem Pin
Mark Salsbery27-Aug-08 8:54
Mark Salsbery27-Aug-08 8:54 
AnswerRe: Setting menu item disabled state problem Pin
nick0122327-Aug-08 9:06
nick0122327-Aug-08 9:06 
GeneralRe: Setting menu item disabled state problem Pin
Mark Salsbery27-Aug-08 9:13
Mark Salsbery27-Aug-08 9:13 
GeneralRe: Setting menu item disabled state problem Pin
nick0122327-Aug-08 9:40
nick0122327-Aug-08 9:40 
AnswerRe: Setting menu item disabled state problem Pin
led mike27-Aug-08 9:09
led mike27-Aug-08 9:09 
GeneralRe: Setting menu item disabled state problem Pin
Mark Salsbery27-Aug-08 9:11
Mark Salsbery27-Aug-08 9:11 
GeneralRe: Setting menu item disabled state problem Pin
led mike27-Aug-08 9:31
led mike27-Aug-08 9:31 
GeneralRe: Setting menu item disabled state problem Pin
Mark Salsbery27-Aug-08 9:37
Mark Salsbery27-Aug-08 9:37 
QuestionCAVI "bitmap" colors - reserved value question Pin
Vaclav_27-Aug-08 8:00
Vaclav_27-Aug-08 8:00 
AnswerRe: CAVI "bitmap" colors - reserved value question Pin
Mark Salsbery27-Aug-08 8:05
Mark Salsbery27-Aug-08 8:05 
GeneralRe: CAVI "bitmap" colors - reserved value question Pin
Vaclav_27-Aug-08 8:22
Vaclav_27-Aug-08 8:22 
GeneralRe: CAVI "bitmap" colors - reserved value question Pin
Mark Salsbery27-Aug-08 8:49
Mark Salsbery27-Aug-08 8:49 
GeneralRe: CAVI "bitmap" colors - reserved value question Pin
Vaclav_28-Aug-08 11:45
Vaclav_28-Aug-08 11: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.