| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Comments:
<0> mk <1> SB_, put the minimum in the header file <0> ok <0> haha <0> my code ****s <0> 100 errors <0> XD <2> Sometimes fixing the first few errors eliminates a lot of other errors <2> On the other hand, sometimes fixing the first few errors creates a lot more <0> JBlitzen, yeah <0> JBlitzen, I seem to be slimming them down <0> stupid **** like forgetting to include headers <0> :) <2> Nice <0> haha, just killed 50 errors by using the proper includes :)
<0> interesting, I thought that a const var couldn't be changed <0> but for some reason to set their value in a cl*** declaration i need to define them as static const? <0> or is const just a by val/by ref thing :O <3> what is a nice c++ book? <0> oh vawjr has that list <0> http://pastebin.ca/38463 (error included) <4> SB_ you don't set default values of non-static members of a cl*** in the cl*** definition <0> rdragon, i mean i changed it, i was just wondering. Thanks for telling me :) <3> rdragon would you say that accelerated c++ is a nice book for learning the langauge? <4> SB_ what's "Rooms" ? <0> rdragon, vector<int> <4> vatoloco - yes. http://www.rudbek.com/books.html <0> rdragon, like it seems like it should compile XD <3> thnx <4> SB_ is this part of a const member function by chance? <0> rdragon, er, vector<room>. const member function? <4> vector<room> ? <0> void CreateRoom(Room Temp) <0> rdragon, yeah, Room is a cl*** i made <4> you can't ***ign a vector<room>::iterator to a vector<int>::iterator <0> rdragon, i just realized how much sense that makes <0> sorry :( <0> you can't do vVec.at(iIter)? <0> hrm <0> nvm <0> haha <0> i **** <5> really? <5> gimme you phone number <0> no... <0> i wish i was getting ***** tonight <0> :P <0> but i mean <0> **** happens <0> or doesn't, in this case. <6> hey guys <6> question <7> Ask. <6> how can i use a type string to find '\n' isinde its seld <6> *self <6> string1.find('\n'); //DOESNT work... <6> anything else? <6> i dont want to use a loop <6> but i will if theres no alternatives <8> if you don't find it, it's not in there <2> Try \r <8> that works sometimes <9> ? <9> Only if you're stupid, I reckon. <9> I mean - they're two different characters, you'd have to not knwo what you wanted in the first place. <10> calc dont work <11> Nothing found for 'dont work'. <10> calc doesnt work <11> Nothing found for 'doesnt work'. <10> damn you calc <6> lol <6> well i think is returning npos <10> you think? <6> when i do the find('\n') <6> no but seriously is there
<6> there are about 16 lines <10> std::string s = "hello\nworld"; std::cout << (s.find('\n') == std::string::npos) << std:: endl; <10> what does this print? <12> why not try it? <10> i'm asking him <6> hum - gives me 0 <6> as in is there <10> then it's finding <6> yea <6> i see.. <10> where are you getting your lines? (maybe you need to check for /n/r or whatever, like JB said) <6> hum this is freaking weird <6> ok my teacher gave me a file (type txt) to parse and sort <0> ++i doesn't like to increment the iterator <6> if he didnt terminate the lines with '\n' and '\r' what the hell did he use? <10> SB_ what? <0> YUY0x7, for (i = r1.begin(); i < r1.end(); ++i) { //it starts at 10 and moves nowhere. <10> a better test in the for condition is i != r1.end() <0> ok <0> well i tried with that as well, and it doesn't increment either :) <10> what do you mean it starts at 10 (and what container are you using?) <0> a vector <10> KBM, how are you reading? <6> a txt file <10> but how <6> fstream <10> why don't you use getline? <0> YUY0x7, http://pastebin.ca/38466 <10> or what are you supposed to do? <6> well i have it so that all the info inside the txt file goes inside a string <6> and from there im parsing <8> why not parse lines one after another? <6> and if i cout my string it gives me newlines - just as if i was reading it in notepad <10> SB_, the problem is your erase <0> I see <0> and how is it a problem? <0> Like, shouldn't i start at 0 and stay at 0 <0> not 10? <10> it invalidates all iterators after the one you erased, so ++i will fail <0> o <10> (and the actual iterator you erased) <0> so how the hell am i supposed to loop through and erase <0> i want to remove the r1 slot at i, not i itself.. <0> :( <10> 1) loop through all, print, and after the loop call .clear() 2) for (i = v.begin(); i != v.end(); i = v.erase(i)) { print_i(); } <10> the first method is probably more efficient if you're gonna remove all <0> nah, i'm erasing on an if statement, this is just a test case <0> :) <6> http://pastebin.ca/38468 <6> line 104 <10> ok.. then for (i = v.begin(); i != v.end(); ) { if (condition) i = v.erase(i); else ++i; } or v.erase(std::remove_if(v.begin(), v.end(), some_conditional_function)); <10> KBM, then there is no '\n' in there <6> ok? <6> so how is it terminating? <6> line 130 Down is the file that im suppost to read <10> ok, have you tried to output sInput? (cout << sInput << endl) <6> yea <6> it gives it to me as if i was reading it in notepad <10> so it prints it like you posted in that bin? <6> yea <10> what OS? <6> XP <6> -5.1 <10> try reading it formatted, not binary <10> std::string everything, line; while (getline(strm, line)) everything += line + "\n"; return everything; <6> formatted? <6> i removed the ios::binary <6> is that wat u mean <6> -if so it still gives me npos <10> use that code and not read <10> istream::read i mean <6> so no is no ate? <6> *in
Return to
#c++ or Go to some related
logs:
#linux #linuxhelp wow-rollhack #linuxhelp #linuxhelp cel mai nou wget de scan _b_str SuSE VA912b
#linux #mysql
|
|