http://ets-wiki.wikidot.com/beginners-guide-for-easy-multibooting
Just FYI...
Last edited by Coolname007 on Sun Nov 08, 2009 4:07 pm; edited 1 time in total
Where there's a place for everything (ok, maybe not EVERYTHING, but close to everything at least).
Tech & World News, Computer Stuff, Martial Arts, Sports, Music, etc. in one single place.
Yeah, spent the better part of the day...kairozamorro wrote:Looks like you spent a great deal of time on it
Honestly, I haven't been spending that much time with it of late, though I know I definitely should if I ever hope to get anywhere. I mean, I've still been studying every once in a while, but not not nearly as much as I need to. I've been busy doing other things.kairozamorro wrote:Well it can be. Implementing the logging capabilities were anything but easy. Next build I'm going to try to put in some support for translations to other languages and maybe support for running with admin rights for non-UAC equipped Windows systems for limited accounts. That's going to be quite another ballpark for me .
Say how's your learning of C++ going? Working on anything or need help with anything?
#include <fstream>
#include <string>
using namespace std;
int main() {
char str[];
ofstream out;
out.open("text.txt", app)
if (!out.is_open()) //check to see if file was not opened
//don't use the filestream
else
out<< "Write a bunch of stuff.\n
"Write a bunch of stuff 2.\n
"This is the end of the file.";
ifstream in("text.txt");
if (!in.is_open()) //check to see if the file was not opened
//do not use the filestream
else {
in >> str;
for (; in.getline(str) != "This is the end of the file.";) {
in >> str;
if (in.getline(str) = "Write a bunch of stuff 2.") {
//write some code which will delete that line -- this is the part i'm stuck at
in.close("text.txt"); //close the file
}
return 0;
}
What does the code box look like from your end? Could you post a screenshot. It looks fine to me.kairozamorro wrote:Awh, that code box is horrible...
Well it looks like you're getting the hang of it. You didn't close your output object though so file would remain locked until you closed the program and than the data wouldn't actually be written out. Its important and probably best practice to only have the stream open as you need it and to close it when you don't. You can't write on the in stream, only read the file in. Its the out stream you write to file from your example. This is where an array of strings for each line read in can be useful. Whenever you close you either haft to create a new object stream to access it again or reasign existing with open.
|
|
Tue Mar 13, 2012 6:17 pm by Coolname007
» Adcted mu online
Mon May 09, 2011 1:15 am by Guest
» The Introduction Thread
Fri Apr 01, 2011 8:36 pm by Coolname007
» Count to one million!
Sat Mar 19, 2011 12:22 pm by Coolname007
» Funny Guy!
Wed Mar 02, 2011 11:25 pm by Coolname007
» China says police killed 12 in Urumqi rioting
Sun Feb 27, 2011 6:14 pm by fvwizard
» Arieth Mu Online
Fri Feb 18, 2011 2:46 pm by Coolname007
» MAW - Make A Website
Mon Feb 07, 2011 8:12 am by Coolname007
» AVACS LIVE CHAT free chat software for mobiles and computer
Tue Jan 25, 2011 2:19 pm by Coolname007