0
Can't get my ATM to work (C++)
10 Antworten
+ 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!
+ 1
Thanks for explaining, i am just a beginner, my friend recommended me this site.
+ 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]
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?
0
sorry, i not too sure how to share code path.
I think i mainly have trouble converting my balance to float.
0
apparently there is a limit to how long the post is since i cant copy paste the whole thing
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
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
0
Can you provide me an example of how to make them both same?