Answer to Question #37894 in C++ for Ivan

Question #37894
I’m learning C in college and when I’m exercising, I stumbled on this task, and it is a problem for me.

Numbers are saved in string, but there are no spaces between them. In order to establish which are this numbers, at the end of the string is information about the number of digits of each number and this information is separated by ”?” …. For example, a valid input string could be 125321?213. Write a procedure int SumNumb (char * str) which finds the sum of the numbers that are written in the string. If the input string is: 125321?213 function should return 12 + 5 + 213 = 230 Formatted file "Strings.txt" contains number of strings, and each of these strings are on a separate line. Example of file: 1010?22 125321?213 1545?4 Note. Considered to be in the file in one line can be most to one hundred characters. How I can solve this problem?

I've started something like that:

int SumNumb (char* str)
{
FILE* f;
int br=0;
f=fopen(str,"r");
int* a[100];
int* b[100];
char c;
int i=0;
1
Expert's answer
2013-12-19T08:25:07-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-37894.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS