✅ c# input and output files
So I am trying to design a code that calculates the area of a triangle giving the values in an input file. the answer will appear in the output file and “invalid” if imported values are entered. the code isn’t crashing, but nothing appears in the output file and idky
8 Replies
What type is writer? Make sure you dispose it before the program exits to ensure it flushes to disk.
Assuming it's a StreamWriter
Usually the best practice for that is to use
using
to ensure it gets disoposed when it goes out of scope.
outputs:
oh yeah it’s stream writer, it’s above the code presented, my mistake
tho i forgot to close the files so it was an endless loop 😭😭
i’m so embarrassed to have such a simple error
ty for ur help :3
Get used to that
Simple errors trip you up the most
i spent two hours looking for an error when i just didn’t a semicolon
😭😭
I've done equivalent things, recently
it'll never stop, no one's gonna judge you for it
get yourself a drink and move on 😉
wasn't that reported as an error by the ide
i didn’t bother to look at the bottom part of the console to see errors listed 🥲🥲 it was my first time writing a program too so i was in my head w everything
the only reason i noticed was bc i jotheeed to look down
bothered
lmao
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.