![]() |
|
Help in simple file input output program - Printable Version +- Little Fighter Empire - Forums (https://lf-empire.de/forum) +-- Forum: General Zone (https://lf-empire.de/forum/forumdisplay.php?fid=23) +--- Forum: Programming (https://lf-empire.de/forum/forumdisplay.php?fid=50) +--- Thread: Help in simple file input output program (/showthread.php?tid=10584) |
|
Help in simple file input output program - InPhiKnight - 12-08-2016 The program adds, display, edit aand deletes records from a binary file. Well the compiler shuts down as soon as I run the program https://www.sendspace.com/file/nfy3h9 Can someone tell me why it ain't working and fix the error? Need for school assignment. Yelp! asap RE: Help in simple file input output program - Som1Lse - 12-08-2016 (12-08-2016, 01:43 PM)davis60 Wrote: Well the compiler shuts down as soon as I run the program https://www.sendspace.com/file/nfy3h9The compiler is what translates the C++-code into what can actually run on your computer. Either the compiler shuts down when you try to compile the program, or the program shuts down when you try to run it. Compiling the program does not run it. Do you have a .exe file you can run after compiling? Do you get an error message? Which compiler are you using? (an old one #include<fstream.h> hasn't been a thing since you were born)
RE: Help in simple file input output program - InPhiKnight - 12-08-2016 Well I didn't tried compiling it, I just ran it and got frustrated. The compiled exe never works in windows 10. So I haven't done it in a while. Using turbo c++, in dos box. Like I said school assignment , and was asked to do in that. Offtopic but I live in a rural area, and teachers here or in our country quite dont update. RE: Help in simple file input output program - Som1Lse - 12-08-2016 Well, so running the code I found a few errors listed here in the order of chance to be what causes the program to fail to compile:
Lastly, please find some way to rate whoever is teaching you as lowly as possible, because using Turbo C++ in a world where GCC, and Clang exist is plain and simply unacceptable. (also consider deleting this thread to remove the evidence of you asking for help, if this works) RE: Help in simple file input output program - InPhiKnight - 12-08-2016 Oh well thanks, Made hella mistakes. Wrote that few hrs ago. My mistake of putting things for last moment. Gonna try to fix them as soon as I get out. Well I cant change the people here, they just wont change! Cant wait to get out of this place after graduation. There is 0.00 probability that someone gonna find this thread from my town lol @Someone else Thank you so much for helping me at the last moment, I made the program work after a few more fixes. What is "using namespace std ;" ? RE: Help in simple file input output program - A-Man - 12-10-2016 Quote:What is "using namespace std ;" ?That expands declarations in a namespace called "std" to the current scope. Imagine you're talking with your friends about Bamboori being a good person and having a nice beard ..etc. It turns out there's a girl in your class with the name Bamboori, and your classmates think you're talking about this girl (oops). Now you talk a lot about Bamboori in your class, and now you have 2 options to clarify. Either you always say "LFE's Bamboori" - like "LFE's Bamboori burns pizza" and "LFE's Bamboori has a cool beard" -, or you just make it clear to everybody that whenever you say any name of a user that's on LFE, you're referring to that person on LFE and not to a person in your school. After that, you can always just say "Bamboori burns pizza" and everybody would understand you're referring to LFE's. You basically told them you'll be using namespace LFE. Similarly, you can tell us on LFE about the girl in your class called Bamboori either by referring to her as "MySchool's Bamboori" (or easier maybe, just write MySchool::Bamboori), or you tell us I'm using namespace MySchooland we'll understand that whenever you say Bamboori afterwards that you're referring to the girl in your school.
Now coutis an object put inside a namespace called "std" together with many other. You're free to declare using namespace std;, or to be safe from ambiguity in case there's some other object called "cout", you can just refer to std::couteverywhere. Doing the latter is good practice. |