| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13
Comments:
<0> Then it's just a copy the other way around <0> ***uming you overloaded Names' >> << <1> MrAshe: ofstream myFile("jav.txt"); <1> myfile << "my file" << "\n"; <1> or <1> myfile << vector[element].getName() << "\n"; <0> ostream & operator <<( ostream & lhs, Names const & rhs ) { return lhs << rhs.getName(); } <0> istream & operator >>( istream & lhs, Names & rhs ) { string s; getline( lhs, s ); Names.setName( s ); } <0> Write: copy( v.begin(), v.end(), ostream_iterator<Names>(file) ); <0> Load: copy( istream_iterator<Names>(file), istream_iterator<Names>(), back_inserter(v) ); <0> Actually <1> ok <0> Write: copy( v.begin(), v.end(), ostream_iterator<Names>(file,"\n") ); <0> Might want a \n there :D <1> ill copy these <1> MrAshe: thank you
<2> All : people are arguing on efnet c++ that C++ isn't made for all kinds of programs, and that managed, and java are more suited for most problems solving <3> Kepler: :) <0> Who cares, it's Efnet <2> yes <0> And you can do managed with C++/CLI anyway <2> wanted to know the opinions here <0> C++ is not suited for everything, indeed <0> But for most stuff, it works just fine <0> I probably wouldn't make a small website in C++ <0> I wouldn't script some UNIX machine with C++ <0> I wouldn't script anything with C++, in fact, heheh <2> but C# as its place <3> yes <3> if you're making GUIs for Windows, C# is pretty good I hear <3> Kepler: I recommend asking your question in #c++ on freenode....people there (from my experience at least) know languages other than C++ fairly well <3> (moreso than the people on efnet or here, it seems) <2> freenode <0> Here we know billions of languages too :p <0> Hell, I even know french :D <3> so they'd be able to better answer your question (just ask at a more appropriate time, as it's early morning US time :) <2> MrAshe : comment a v <3> bien <2> ah c'est cool parler franais en pleine nuit <0> Ok ok, I lied <2> haha <0> Or maybe not <0> Who knows <3> lol <2> what I said <0> J'en sais rien je parle pas francais <2> I see <2> where's you from <0> A little bit of everywhere in Europe <0> Today .be <2> ok <0> Next week .pt <3> the most boring part of it <0> Next week(s) .pl <2> is europe cool ? <0> Not, it's almost 25 degrees (C) <3> MrAshe are you looking forward to the World Cup <3> or are you a loser like Asriel and you don't care <0> I don't like watching sport, I prefer playing <2> or you prefers the states ? <3> pfff <3> ok fine <0> Kepler: dunno, I don't have any preference <2> ok night all <1> ios::out has not been declared <1> i already did #include fstream <4> Does anybody knows how to connect to a ODBC db? <5> http://www.break.com/index/evolutiondance.html <- omfg ahhahahaha <6> ? <7> ice <1> how can i send .cpp and .hpp files thro email? <0> huh? <1> yes <1> i try to zip them <1> and yahoo
<1> did not honor it <1> failure notice <8> rename them to .txt if there is some mail scanning thingie blocking them <0> Not sure why anyone would block .cpp/.hpp in a zip <1> ok thanks <8> our mail thing at work blocks everthing that looks like script/code <9> afternoon Sol <10> This gives me headaches <10> error: no matching function for call to BinaryExpression<true, BinaryExpression<false, BoolExpression<false>, beop_AND, BoolExpression<false> >, beop_OR, BoolExpression<false> >::BinaryExpression(const BinaryExpression<true, BoolExpression<false>, beop_AND, BoolExpression<false> >&, const BoolExpression<true>&) <1> can i convert int to string? <10> Real Programmers do EVERYTHING in octal. <1> can't find parseInt <0> stringstream <0> parseInt is string to int anyway <10> http://www.rafb.net/paste/results/bfuF9Z71.html <10> (Evil code) <1> what makes it evil <10> Try to understand it :) <1> too complicated <10> It automatically translates: <10> !(b1 && b2) && b3 into !(b1 && b2) && b3 (the same thing) <10> but <10> !(b1 && b2) && !b3 into (b1 && b2) || b3 <10> err, the first call is a different function, I meant: <10> (b1 && b2) && !b3 into (b1 && b2) && !b3 (the same thing) <10> at compile time, thus. <10> Wew, I finally defined all of operator&&: http://www.rafb.net/paste/results/nGPg5P20.html <11> If you have an abstract cl***... Is it usual to just declare the attributes; but not declare a proper constructor (except the default one) for the abstrac cl*** - and then instead instantiate the attributes of the base cl*** in the derived cl*** instead? I.e. constructor in base cl*** (abstract) has no arguments, but constructor in derived cl*** has them and sets them? <10> no <11> is there an equalent to "super.attribute" in java? <10> I don't know java <11> what is the best way to do it <10> An abstract cl*** is a cl*** with an abstract virtual function right? <11> yeah a pure virtual function <10> Or with only pure virtual functions? <11> basically no instance of this cl*** is ever created... but I need to set some attributes that it has when deriving cl***es use it <10> I always write constructors for it. <12> Antrix> super.attribute == cl***Name.attribute in c++ <12> cl***Name::attribute <11> so I just have the deriving cl*** contain all arguments for base cl*** *as well* as it's own, and use super to ***ign initial values? <11> if anyone has a solid article on inheritance in special relation to constructors etc. it will probably save your time... But i failed to find any - the examples i googled up are to simple <0> derived::derived( argforparentcl***constructor ) : parent( argforparentcl***constructor ) { } <11> ahhhhhhh <11> that makes sense <11> thanks :) <10> I didn't even understand the question... how am I supposed to guess you didn't know that? :/ <0> I guess abstract == cl*** that you can't instantiate (due to a pure virtual) <11> aye <0> And everything pure virtual (and usually no member variable) == interface <10> It wouldn't make much sense to have a member variable in a cl*** without non- pure-virtual functions, or it would have to be a protected variable that is directly accessed from the derived cl***es; however - then it would be uninitialized. As soon as you write a constructor to initialize it, then the cl*** isn't 100% pure virtual anymore. <13> i need function that can read char by char cin.get() not good for me <10> Initializing it from the derived cl***es (with direct access) is plain dirty. <11> mm... <10> fozo: There is nothing else in C++. If you use lower level accesses, then it is not portable anymore, so specify your OS. <13> unix <13> g++ <10> The problem with unix is that your I/O is by means of (virtual) terminals, they are usually buffered. That is: your application won't see a character until you hit Enter. <13> i thought maybe use gets function in stdio.h maybe <10> If you want to change that, then you will have to tell the terminal it has to stop buffering. You can do that with escape codes that differ per terminal (ie, Xterm) <14> wasn't there something called getch() or getc() in unix? <13> so how i can do that cin.get() will start working so <10> The normal way is to use a library that knows how to treat all the different terminals (libncurses) <10> Yes, then cin.get() should work too. <13> how i do that ? <10> I never needed it myself though... if I need to wait for 'any' character, I just ask to hit Enter, instead of Space ;) <10> initscr();/* Start curses mode */ <10> then getch() works <10> http://www.ibiblio.org/pub/linux/docs/HOWTO/other-formats/html_single/NCURSES-Programming-HOWTO.html <10> Used that to learn that... <10> You might have to do a cbreak() too. <10> cbreak();/* Line buffering disabled. p*** on everything */ <13> run are you here ? <11> so you are basically saying that having an (abstract) cl*** containing its own attributes, pure virtual functions and virtual functions is silly ?
Return to
#c++ or Go to some related
logs:
#c++ #london Caihpirina #linux BindingSource1.Filter JacaScript scroll bar fedora psradm command
ar325w ipv6 #c #linux
|
|