0

Can't get my ATM to work (C++)

https://code.sololearn.com/ckAf34JDc5A8

12th Aug 2018, 7:07 AM
Joshua
10 Answers
+ 2
Joshua it's easy! open your code in Code Playground editor, then tap on the share button at the top right (on mobile) and pick an option that suggests to copy to clipboard. If you're on SoloLearn web version you can copy the code url from the address bar. Next, back to this thread, edit your question, and paste the URL on the Description section, that's it!
12th Aug 2018, 7:22 AM
Ipang
12th Aug 2018, 7:25 AM
Joshua
+ 1
Thanks for explaining, i am just a beginner, my friend recommended me this site.
12th Aug 2018, 7:27 AM
Joshua
+ 1
Joshua as your file input is having proper format, read your file as per below link example... this allows you to make balance as float... b is already float for you.. http://www.cplusplus.com/reference/cstdio/fscanf/ change string balance [100] as float balance [100]
12th Aug 2018, 7:55 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Joshua could you please share your code path in comment so that we can directly check that one?? and what problem you are facing?
12th Aug 2018, 7:13 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
sorry, i not too sure how to share code path. I think i mainly have trouble converting my balance to float.
12th Aug 2018, 7:17 AM
Joshua
0
apparently there is a limit to how long the post is since i cant copy paste the whole thing
12th Aug 2018, 7:19 AM
Joshua
0
it's too easy to share... on your code, at top where code name appears, share icon is there.. click on it and find option to save to clipboard... its path is copied now and just paste it here in comment section
12th Aug 2018, 7:20 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Joshua I checked and got an overview.. as you are reading file which is formatted, you can read balance as float directly using fscanf.... currently you are having data type of balance as string while reading and you are directly updating float values to string type data balance. this might be causing problem. Ensure both data types as same for b and balance. this may help you... feel free to ask for clarification
12th Aug 2018, 7:33 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Can you provide me an example of how to make them both same?
12th Aug 2018, 7:48 AM
Joshua