![]() |
Reading of Input
Hey guys for my assignment i have to write a program which checks the information inside a text file to make sure it is all integers and then convert the integers to roman Numerals. My program seems to have a bit of a problem and im not sure where exactly the problem is....
Code:
#include<stdlib.h>123 THe program works fine. It is able to check if the string is just all numbers or has some alphabets. After checking, it will the pass the input into the other function to convert it to Roman Numeral. Thus, the output will be.... CXX111 which is correct. But when my text file has data in this way... 122 123 For some reason, it will not work fine. In fact, the output will be... it has alphabets CXX111 From the input, you realize that the program seems to read the first input wrongly and only read the 2nd one properly. To check for mistakes, i took out the function to check for integers and just run it throught the function to convert the input into Roman numerals. In this case. the program worked and i get the correct output which is... CXX11 CXX111 So i guess the problem might lie in the way the checking for integer function pass back the input into the main and into the other functions. Im very sure the functions are working properly. So i guess it has something to do with the way the information is passed? If anybody has any idea bout this, please tell me how i can solve this issue. |
Re: Reading of Input
Code:
|
Re: Reading of Input
1 Attachment(s)
with this code
Code:
#include<stdlib.h> |
| All times are GMT +5.5. The time now is 17:11. |