| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> rdragon yep <1> i just didn't understand why ones had to be overloaded an how for what i was doing, if i made a list of employees as apposed to string <2> the Bresenham algorithm is good for that <0> rdragon from what I read, that's what this one is based on <3> Jazy84 i have no idea what you mean by that <2> Graveling it doesn't look like it <1> http://www.noidea128.org/sourcefiles/16121.html <2> oh actually, maybe it does <3> Jazy84 you're writing your own hashtable? <1> yes <2> except that this only handles drawing when deltaY > deltaX <3> another teacher that want's to re-invent the wheel <3> <sigh> <0> that one I have the link above for seems to only create a line in a positive gradient. I have to be able to click on two points on a screen and draw a line between them <2> okay <2> then...
<3> Graveling why not plot the middle point, then call yourself twice with one end, middle and middle other end <0> hmm <3> no need to check for quadrants, or which is larger, etc <0> the main problem I am having is that it will only plot directly in one direction. I cant seem to see whay <0> err, why <3> presuming that a.x+b.x)/2 <3> aargh <3> presuming that (a.x+b.x)/2 doesn't overflow <4> and if its plottable on the screen, it liekly won't :) <4> untill you do conversaion to screen coordinates part <0> I can get it to plot a line in +x, but only between 90 and 135 degrees <2> Graveling take a look: http://www.noidea128.org/sourcefiles/16122~ <2> it can be made a bit more efficient with pointer arithmetic, but there's the general idea <2> you might also check to clip the points <5> Did you see my earlier rant vawjr? <0> ok <5> hmmm, guess you're not here. heh, oh well. <2> Graveling the algorithm has to be split up depending on the slope of the line <2> because you want to iterate over the axis that only has 1 pixel per row (or column) <2> to draw <2> then for each iteration, you can decide whether you need to move up/down a pixel on the other axis <2> the numbers are blown up here to work completely with integer arithmetic <1> friend ofstream& operator<<(ofstream& to, Employee &what) { <1> to<<what.name<<" "<<what.id<<" "<<what.dept<<endl; <1> return to; <1> } <1> what is wrong with that? <2> you can't define something where you're declaring it 'friend', I don't believe <3> Jazy84 Employee const & <3> and why must it be inside the cl***? (no real problem doing it that way, but why? <2> ah, k <3> Noidea no, I don't think so...do I really want to? <2> defining it like that within the cl*** makes it a free function? <1> doesnt' have to be :) <3> rdragon I guess so, why? <6> Were you around for the other night's discussion of California's elephant protection law, vic? <3> no, and I'm glad I wasn't <2> wasn't sure if that was legal or not <6> Only if it doesn't harm an elephant in California <1> darn i still get 2 errors <2> struct A{ friend void f(){} }; int main(){ f(); } <2> vc8 complains that the candidates for 'f' are inaccessible <3> huh?? <7> eh? <3> Jazy84 I can't read your mind tonight... what errors? <1> hold up <3> http://www.nytimes.com/2006/04/04/us/nationalspecial3/04scotus.html?ei=5094&en=4bb297bacb8e14d3&hp=&ex=1144123200&partner=homepage&pagewanted=print <3> oh ****, this court isn't any better than the previous 6 or 7 <1> http://www.noidea128.org/sourcefiles/16123.html <2> 10000 lists? yikes <4> haha, thats what I said. <2> **friend <-- huh? <3> #include <fstream> <3> but that's likey NOT what you want <2> are you sure you want it to be an ofstream and not simply ostream? <3> you likely want ostream <8> hi <8> is float arithmatic faster than double? <3> dextre1 depends on the machine <2> Jazy84 I think you're going to run into another problem after you fix that, too
<8> arithmetic.. on a pentium <3> I don't know, and I don't care <4> hehe <2> dextre1 why don't you just try it out and see? <3> it's irrelevant to C++ <8> ok <2> get a stopwatch, and run your program, then change the code and time it again <3> and all you'll find out is if it's faster on YOUR machine <1> alright if i add ostream <2> Jazy84 you changed the return type too, right? <3> oh and put it in Employee, not hash2 <2> er, yeah <1> both to ostream right? <2> ...yes <2> 10000 member list objects isn't a great idea, idea <2> neither is using character pointers as strings <2> neither is using a signed type to represent size/length <2> neither is instantiating an iterator object, and then using indexes on the next line to iterate <2> neither is this loop: for(int i = 0; i <= keyLength; i++) which oversteps the bounds of the 'string', which is why you should be using real strings <2> neither is having three 'setXXX' functions, when the member they set is public <3> gonna call it quits, I'm somewhat under the weather today <6> Night, vic <1> quick question <1> Employee& operator==(Employee const & what); <2> no <1> i'd want to use something like that to overload == <2> == should return true/false, come on <1> opps the = <1> rather <2> okay, then yes <9> Hello <2> you should also remember to check for self-***ignment in that function if( &rhs == this ) return *this; <1> but now that we are talkinga bout == i'm checking it by an *iter==item <9> I can return error with extended information from ATL DLL using this kind of thing .. >> return Error("Wrong number!", GUID_NULL, E_INVALIDARG); <1> now in the overloaded== what should i compare? <2> you should check for equivalence <9> What if my function is a void function and not STDMETHODIMP <9> ? <2> or maybe you check for equality... I guess it really depends on the design <1> lets say i wanna check an input string for equivalence on one of the strings in my cl*** <2> if( str1 == str2 ) <1> will something like this work <1> bool Employee::operator ==(const string &what) {if (what = this.name)return true;else return false; <2> return( what == this.name ); <1> error C2228: left of '.name' must have cl***/struct/union type is 'Employee *const <2> duh <2> return( what == name ); <2> you wrote this. and I pulled a JBlitzen and retyped it <1> ah don't need the **** <1> this* <2> ;) <6> Don't make me abuse you with block and tackle <6> I might make that my next slap message <2> heh <2> oLDmeMoRy don't private message me <2> ask in channel like everybody else <6> You ever play Shadow of the Colossus again, rd? <2> yeah I still do <2> haven't beaten it yet <2> I think I have 3 or 4 more colossi to go <2> i hate the ones that shoot back, lol <6> Nice <2> but the last 2 I fought were pretty creative <1> http://www.noidea128.org/sourcefiles/16124.html <1> can you take a look at my search function <2> how about you put a break; after found=true; <2> or better yet <2> return <2> why are you comparing Employee 's to strings ? <2> and you should p*** that string in by const reference <2> and why is key a const char* and not a string? <2> and why don't you just use a std::map or something?
Return to
#c++ or Go to some related
logs:
#windows OLD_PASSWORD mysql 1064 42000 Nadezhda, Craigslist
#teens decrypt gzinflate chanset flood #php #php #java palmiros
|
|