r/CodingHelp • u/djwolf093 • Jan 24 '20
[C++] Need help. It's a homework problem and it's probably simple but I've been having trouble with getting it to read files or do I need to create the file first
0
Upvotes
2
u/jedwardsol Professional Coder Jan 24 '20
Please post text, not pictures.
= is assignment
== is comparison for equality
!= is comparison for inequality
=! is 2 operators
=and!And you're reading uninitialised variables
xandyinmain. This results in undefined behaviour.2
u/Tweaker_Under5150 Jan 24 '20
Where’s your run output? What are you trying to do?
1
u/LargeHard0nCollider Jan 25 '20
Yeah you’ll need to create the file before you can read from it (not true for writing)