Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remote Database Connectivity Pin
Abbas_Riazi2-Feb-03 4:01
professionalAbbas_Riazi2-Feb-03 4:01 
GeneralRe: Remote Database Connectivity Pin
Tarun Dutt Mathur3-Feb-03 0:43
Tarun Dutt Mathur3-Feb-03 0:43 
GeneralWindows Services Pin
Christian Graus1-Feb-03 20:26
protectorChristian Graus1-Feb-03 20:26 
GeneralRe: Windows Services Pin
Anders Molin2-Feb-03 8:40
professionalAnders Molin2-Feb-03 8:40 
GeneralRe: Windows Services Pin
Christian Graus2-Feb-03 9:40
protectorChristian Graus2-Feb-03 9:40 
GeneralRe: Windows Services Pin
Anders Molin2-Feb-03 10:48
professionalAnders Molin2-Feb-03 10:48 
GeneralRe: Windows Services Pin
Christian Graus2-Feb-03 10:59
protectorChristian Graus2-Feb-03 10:59 
Generalatoi conversion does not work Pin
geralt1-Feb-03 19:01
geralt1-Feb-03 19:01 
Hi everyone.
I am working on a small program for school project. Apparently the teacher does not want to help so I decided to look for a help on the message board.
I need to write a function that takes seven digits input by user
ex. 123454 store them in the array and after that do some mathematical operations on them such as add, multiply.
Well, I can read them in as characters and tried to converted them into int after inputing to array but did not work.
I tried casting with the same result.
Can anyone suggest what should I do in order to read in as characters and convert them into integers. ( the whole program should resemble calculator that will add two big numbers let say 16 digits.)
Any help would be appreciated.

Here is my code.
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
void main() {

const int ROWS = 6;
char inNum1 [ROWS];
int sum = 0;
int conValue = 0;



cout << " enter your number" ;
for ( int i=0; i <rows; i++="" )="" {
="" cin="">> inNum1[i];

}


cout << "num [0]= " << inNum1[0] << endl;
cout << "num [1]= " << inNum1[1] << endl;
cout << "num [2]= " << inNum1[2] << endl;

for ( int j = 0; j< ROWS; j++ ) {
sum += inNum1[j];
}
cout << "total sum = " << sum << endl;

}Frown | :(
GeneralRe: atoi conversion does not work Pin
Michael Dunn1-Feb-03 19:19
sitebuilderMichael Dunn1-Feb-03 19:19 
GeneralRe: atoi conversion does not work Pin
geralt2-Feb-03 11:50
geralt2-Feb-03 11:50 
GeneralRe: atoi conversion does not work Pin
Ted Ferenc1-Feb-03 21:37
Ted Ferenc1-Feb-03 21:37 
GeneralRe: atoi conversion does not work Pin
Mike Nordell1-Feb-03 23:11
Mike Nordell1-Feb-03 23:11 
GeneralRe: atoi conversion does not work Pin
geralt2-Feb-03 11:49
geralt2-Feb-03 11:49 
GeneralLooking for a tip Pin
Abin1-Feb-03 18:08
Abin1-Feb-03 18:08 
GeneralRe: Looking for a tip Pin
Abbas_Riazi1-Feb-03 18:33
professionalAbbas_Riazi1-Feb-03 18:33 
GeneralRe: Looking for a tip Pin
PJ Arends1-Feb-03 18:47
professionalPJ Arends1-Feb-03 18:47 
GeneralObjects and Pointers Pin
_psh_1-Feb-03 17:56
_psh_1-Feb-03 17:56 
GeneralRe: Objects and Pointers Pin
Chris Losinger1-Feb-03 19:17
professionalChris Losinger1-Feb-03 19:17 
QuestionHow to resolve a corrupt stack Pin
Obliterator1-Feb-03 17:45
Obliterator1-Feb-03 17:45 
AnswerRe: How to resolve a corrupt stack Pin
Chris Losinger1-Feb-03 19:20
professionalChris Losinger1-Feb-03 19:20 
GeneralRe: How to resolve a corrupt stack Pin
Obliterator5-Feb-03 9:54
Obliterator5-Feb-03 9:54 
Generalstop my MDI app from creating a child window Pin
Perseus1-Feb-03 15:45
Perseus1-Feb-03 15:45 
GeneralRe: stop my MDI app from creating a child window Pin
Obliterator1-Feb-03 17:24
Obliterator1-Feb-03 17:24 
GeneralRe: stop my MDI app from creating a child window Pin
Perseus1-Feb-03 17:47
Perseus1-Feb-03 17:47 
GeneralRe: stop my MDI app from creating a child window Pin
Alexinuk2-Feb-03 23:00
Alexinuk2-Feb-03 23:00 

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.