| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<binrapt> b1999: byte = byte << 1; <b1999> lol <b1999> of course <Kniht> b1999: if a += 1 is a = a + 1, then that is ... <b1999> can you guys come to the exam with me? <binrapt> Sure, to tell the teacher that you are cheating. <NKD> lol <b1999> you're saying you never cheated ? never got 'help' from soneone? <Kniht> there's a difference <roopjm> i cheated like a mother**** in 8th grade... teacher didn't teach, just put notes on the overhead, so we said **** her and blatently cheated <binrapt> Does somebody use 'int const' instead of 'const int'? <Soronel> roopjm: they were probably the same notes the teacher used the previous year too <Kniht> binrapt: i've been going in that direction <Soronel> binrapt: I've been trying to change my default style to use type const <Soronel> though it conflicts with VS quite a bit <binrapt> Oh, how does it conflict? <Soronel> intellisense always shows it as const type, regardless of how you write prototypes/definitions etc <Symmetry_> binrapt: sounds perverted to me <binrapt> Symmetry_: Why? <Kniht> Symmetry_: const int is a special case <Symmetry_> I meant kinky. nothing wrong with the way our ancestors wrote "const int" <Symmetry_> oh really... how? <Soronel> Sym: the fact that const type works at all is a sortof artifact <Kniht> calc const rule <CalcMe> const rule = The keyword "const" modifies what it is after, unless there is nothing, in which case it modifies what it is before. Thus, the type "const int" is a special case and means the same as "int const". See also: calc method const <Soronel> Sym: the general rule is that such modifiers apply to what is to the left of the modifier <Symmetry_> ah, so it's not different after all <Symmetry_> I see. good to know <Soronel> calc test <Symmetry_> so the canonical way would be int const? <binrapt> Nod <Soronel> hrmm <Symmetry_> hah. <Soronel> okay, brb <binrapt> Hmm I love order, I think I will start using it <oxix_m> I used to put comments above include guards, but Sutter says not to <oxix_m> apparently compilers can detect include guards early or something and not putting anything before them (including comments) can help <oxix_m> you guys do that? <Genia4> http://bash.org/?105481 read and learn! <binrapt> oxix_m: Yes <YUY0x7> Genia4 LOL <oxix_m> binrapt: put comments above include guards or avoid doing that? <binrapt> oxix_m: Not putting comments above include guards <oxix_m> ah <Supram> Hey.. I gota few questions about c++.. I wanne try to start to learn the language.. But what do i need to start with it? What kind of programs? <oxix_m> I like it now because it's nice and uniform <Supram> Do i need a compile program etc? <oxix_m> always at the top of any of my headers is an include guard <binrapt> Supram: A book and a compiler <Supram> Where do i get a compiler ? <binrapt> Book: Accelerated C++, www.acceleratedcpp.com <binrapt> Compiler: Dev-C++ for example, www.bloodshed.net, free <Supram> thanks alot. <oxix_m> return (a > b) - (a < b); <-- wazzat do? <oxix_m> a > b and a < b can't both be true <oxix_m> so it can be 1 or -1... or 0 if both aren't true <oxix_m> is that just a clever way to write like a cmp function? <wilx> Heh, interesting. <wilx> Probably. <oxix_m> ah - that makes sense in this function's context <oxix_m> looking at C code <oxix_m> that's a clever way to do it <oxix_m> though C++ doesn't make use of any cmp functions like that generally, or does it? can't think of any STL parts that uses functions like that to order things <oxix_m> strict weak ordering predicates for set and map <Kniht> the STL uses a single comparison functor that is called twice (with arguments reversed) to determine equality <oxix_m> ah <Kniht> similar to the code you pasted, except use < instead of > and switch arguments <Kniht> template< typename T, typename F > is_equal( T const& a, T const& b, F f ) { return !( f(a,b) || f(b,a) ); } // where f returns true if the first parameter is ordered before the second parameter <oxix_m> very tight logic <oxix_m> i like it <Kniht> usually i use it like if ( f( a, b ) ) { /* handle a ordered before b */ } else if ( f( b, a ) ) { /* handle b ordered before a */ } else { /* handle equality */ } <oxix_m> guess in C they want to jam more logic in there since they can't inline the function call using function pointers <oxix_m> ah, no wasted comparisons that way <kaber2> hey <oxix_m> hi <kaber2> if any of yall are on a fast connection. which are you gettin faster pull speeds at <kaber2> http://www.fileget.net/test100M.dat or http://www.liquidweb.com/data/100mb.bin <kaber2> on cable. liquidweb is about a 100kb faster <skie> kaber2: 257 on the first, 389 on the second <kaber2> k <skie> I can try from work (university connection) on tues, but I can't RD into my machine right now <kaber2> aite cool. appreciate that <skie> trying to decide who to host with? <kaber2> i'm ssh'ng it from theplanet and i'm pulling from liquidweb about 1.2 MB <kaber2> yea <skie> hm. actually, I can try from OSU> <skie> I forgot I had a shell acct <skie> fileget hates OSU. 50kbps on fileget, 1.7M on liquidweb <Ghostmod`> i get the following linker errors in VC++ 6.0, http://rafb.net/paste/results/J9jsFN77.html with the suggestion of using /NODEFAULTLIB:library. Where do I put this? I throw it in the box in the project->settings->link that has a list of all my linker options, but it doesn't change any of the errors. <skie> (and liquidweb was still going up when it finished) <kaber2> guess no contest. liquidweb is way faster then ev1server's <skie> some of it may be DC location <skie> & just how it gets routed <Ghostmod`> kaber2: you looking for a webhost provider? <Supram> Hmm.. i downloaded a project that i could edit. And i downloaded dev-c++ 4 too. But how do i compile the project? Its more that one file and i can only open one at once in the dev program? <skie> Supram: makefiles. <kaber2> aite, gonna go ahead and get it with liquidweb <kaber2> Ghostmod`: dedicated server's <Supram> skie, its my frist time will you please be a bit more precis? <Ghostmod`> kaber2: well ev1 servers get good speeds in general, not just to a few random specific places <Ghostmod`> the planet is good too <kaber2> yea <kaber2> I contacted them, but there all sold out <Ghostmod`> my server is in a savvis data center <Ghostmod`> the planet goes through savvis iirc <skie> kaber2: try to get some Level3 bw :) <Ghostmod`> just stay away from anyone that mentions 'cogent' <skie> heh <Soronel> that was annoying <kaber2> hehe <kaber2> but liquidweb is running CentOS 4. But i think that's fine, we just need to be on the new 2.6 kernel <kaber2> yea. Centos4 has 2.6 installed <Asmodee`> you could always do an upgrade as soon as your server is installed <Asmodee`> i plan to start reselling space where my server is soon ;P <kaber2> hehe <skie> kaber2: what are you getting a ded box for? <kaber2> for some server software needs 2.6 and own box <domaro> i include #math.h yet i still get linker errors when using log() or other math functions...does anyone know what i need to do to fix this? <skie> link with -lm <jakl> hi, i declared an array of BallType which is a type from a library i downloaded. So i declared that array as a member of my cl***. However, i wanted to initialise that array in one of my function like this : BallType types[16] = {CUE, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN, FOURTEEN, FIFTEEN}; but for some reason it won't work unless i declare it global to the whole file... <domaro> ok thanks skie <Asmodee`> anyone know of other ways to force VC++ to not link standard libraries aside from /NODEFAULTLIB:library? it doesnt seem to have any effect when i throw it in to my link options <YUY0x7> jakl, what does "it won't work" mean? <jakl> i mean by that, that the whole array is instead initialised to 0 <jakl> ONE TWO THREE...etc are types defined to 1,2,3... <agentsim> jakl: you cannot ***ign a value to an array using the {1,2,3} format, that is for initialization only <Supram> what happen after i compile a file, ? <jakl> so i will have to do types[0] = CUE, types[1] = ONE etc..? <agentsim> jakl, yep <YUY0x7> he is initializing there, so it should be fine <jakl> well actually, in the declaration of my cl***, i have BallType types[16]; and then later on in one of my functions i wanted to do initialise types[].. <Supram> what happen after i compile a file? <Supram> Because seems that nothing happen here <YUY0x7> jakl, oh well if it's a member variable you might not be able to initialize it like that <kaber2> aite guys, i g2g. peace <agentsim> you might be able to do it like that if you can initialize during construction <YUY0x7> the only way i can think of would be in the constructor, mycl***() : types({CUE,BLA,BLY}) {} but iirc that doesn't work :/ <agentsim> hence the "might" in my suggestion :) <YUY0x7> jakl, is this a static member? <Indi_J> can't you make a hidden array that's already initialized, then just copy? <piz> hey. i need to get advice, i want to start learning programming language, which one i should start with (it's better to be a "new" language and not an old on that doesn't support any more or a lot) <Indi_J> or even better, wouldn't this work better as an enum? <upb> php or vb <piz> upb, php is a website programming language no? <upb> yes <piz> and c++ is for websites as well? (sorry for ignoarnce) <YUY0x7> dont recommend vb :/ <YUY0x7> piz, no.. C++ is a general purpose language <upb> just trying to avoid competition here :P <Asmodee`> if you intend to do application development learn C++, if you want to do low level stuff, like embedded systems start with C
Return to c++ or Go to some related
logs:
penntechnical.com osdev
|
|