| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> fair enough. <1> your way we'll never get any****ing where <2> You definitely don't need to understand arrays in order to be able to use std::vector correctly and idiomatically. <3> vawjrwrk : It's just usually easier to learn from bottom to top than it is the other way around :) <1> people will be studying low level **** for millenia <0> millenia? <1> PM2 do yoiu drive a car? <0> a few months maybe. <4> vawjrwrk: and does it use boost, too ?) <0> vawjrwrk : such a bad analogy <3> vawjrwrk : Yup ... <1> PM2 can you build a transmission for your car? <0> compare desigining software to designing a car. <1> NineVolt <0> compare using software to using a car. <1> ok, ***hole....can you write a floating point package
<2> melfar: I wouldn't be surprised if my car uses Boost. <3> vawjrwrk : I wouldn't be able to build one, but I do know what it is! <0> i should hope so. <3> vawjrwrk : and how it works ;) <1> ok, put one together.... and NO ****IUNG floating point instructions used either <0> being that i work with risc systems from time to time, i oftentimes have to code the most trivial of crap. <1> NineVolt do you consider that knowledge essential for ALL programmers? <0> no, but i consider it knowledge that's useful for ALL programmers. <1> all BEGINNERS? <0> no. <1> before they've ever used float or double? <5> it couldn't hurt knowing how something works - but it's far more important to know how to use it correctly <1> if NOT, then wy is it "essential" they learn array before vector?? <0> because vector isn't an implementation of the idea of an array. <0> whereas the float datatype is an implementation of the idea of a floating point number. <1> you think array is fundamental then, eh? <3> Ok NineVolt and vawjrwrk, I'll ask my previous question again, for you to answer, ok? <1> PM2 peter answered your question <0> i think 0s and 1s are fundamental :P <0> but an array is more fundamental, and much simpler, than a vector. <6> his later question went unanswered i believe <5> there are no 0s and 1s in a computer, only different voltages <0> ... <4> I know guys, that do some low-level stuff, and doesn't know how the bit operation & properly called and what it does actually <5> so every programmer must learn electronics first <6> PM2, you would delete the object being pointed at by the array element (***uming it's the last pointer in use), and set the array element's value to null <3> It did go unanswered yes :) <0> so i guess it's good that i'm double majoring in compsci and compeng. <2> Do you think understanding of thermodynamics is needed in order to work with a bit? <1> NineVolt I guess <2> exception: it certainly doesn't hurt. <3> peterhu : Ok ... so if you print all the objects in the array, one by one, after having deleted one, it would skip the deleted one without the user noticing anything? <0> not an array, no. <2> You can't delete anything from an array. <0> you can't "delete" from an array. <5> _m_ : there is know knowlege that hurts - maybe except causing a headache - but how does understanding of semiconductors actually benefit you when designing a software system ? <3> peterhu : oh... sorry, it would not necesserly be the last pointer used ... <5> there is no knowlege, that is <0> i never said understanding semiconductors would help. <0> understanding computer architecture would though. <2> exception: it helps you understand timing issues, bandwidth issues, etc. <7> hey, are you trolling ? <6> PM2, by using an constant-sized array of pointers, you can't actually remove any element from the array. what you can do is set an array element to null to signify it is not in use, which will have to be taken into consideration wherever the array is accessed <3> peterhu : In other words ... using an array of objects is stupid? <1> there may be no other choice (as you've said) <1> not in real life, but in this stupid hold your prof has put you <0> an array of pointers to objects is often a better idea.. <5> PM2 : if you add and remove items frequently, in real life a list could be a better idea <3> NineVolt : I am using an array of pointers <0> then what's the problem? :P <5> due to a stupid professor you might have no choice <1> provided you understand about exceptons and that you must give all the memory back <3> Ok wait ... <3> Let's start from scratch ... <3> I have an array like this : ObjectWhatever* arrOw; <3> Everybody understands that ... <2> That's not an array. <2> So much about "everybody understands that". <3> ObjectWhatever* arrOw[50];
<3> That better? :P <2> That's an array of pointers, yes. <3> Ok <3> Than I'm gonna fill that array with a function that returns an object : <3> arrOw[i++] = functionReturningTheObject(); <6> (returns a pointer to an instance of ObjectWhatever) <3> (where ObjectWhatever* functionReturningTheObject(){...}) <3> peterhu : yeah <8> std::vector<ObjectWhatever *> arrOw; arrOw.push_back(functionReturningTheObject()); <0> eew. <3> So you've filed that array of pointers from a file containing many instances of the ObjectWhatever, in this case, appointments <0> std's. <5> troll alert <0> ah fine :\ <3> After reading that file and filing the array, the user has three options : adding an appointment, removing an appointment and examining the appointments ... <3> So the user could delete an appointment, add one, add a second one, and list them all using the third option ... <0> in all seriousness though, i doubt it would go over well with a professor if you did your arrays lab using vectors. <3> And when the user quits, all the appointment in memory are saved in the file <6> is there a maximum number of appointments defined (***umed this is a homework ***ignment), or do they expect to support any number of a appointments? <3> THAT is what I gotta do ... <5> NineVolt : there are things you do for the grade, and then study the real stuff <3> It IS a homework ***ignment lol <0> exception : the 'real stuff' is subjective. <5> I have an ***ignment I *must* do in VC6... screw them <3> peterhu : the prof did not mention anything about a max no of appointments <0> it's ***umed that there's a reasonable amount. <6> then you can't use a constant-sized array <3> I know! <3> But I don't ... <3> Hmmm ... <0> i doubt they're expecting you to build a linked list if they're just teaching you arrays. <6> you, unfortunately, need to reimplement vector <5> PM2 : whenever you delete, you can shift all the items after it so you'll have a continous block <3> NineVolt : We DID see linked list ... <0> ah. <5> then you can always add at the end, and if you run out of place - reallocate to a bigger array <6> can you use std::list? <0> then perhaps they expect you to do that after all then. <3> peterhu : nothing std <3> NineVolt : I guess so ... <6> i fail to see the logic of teaching a language but prohibiting the use of the language <0> you know, since someone here brought up the car analogy.. <3> As the prof could test our programs using a HUGE 1000 appointments file! <0> there's mechanics, and there's engineers. <0> i'll just leave it at that. <8> well, pointers dont take up that much space <3> So now I'll have to learn to use linked lists again! Crap! lol <8> learn.. again? <9> for Simpsons fans <9> http://www.thesun.co.uk/article/0,,2004580002-2006100428,00.html <3> Tamama : I guess so! :( <3> peterhu : You know what?!?! I'm gonna send an e-mail to my prof right now, see if I can use vectors! :) <0> depends if it's a cl*** on c++ or on software design. <1> PM2 NOTHING std:: ? how do you do input and output? <2> ask for std::string, too, while you're at it. <3> NineVolt : C++ <3> vawjrwrk : Sorry, my mistake! I meant STL ... ;) <3> Not the same! <0> o_O <5> no STL, just standard c++ <1> STL doesn't exist, it was subsumed into the standard library <2> No, you meant standard library, hopefully. <4> you cant know STL from std these days <2> calc real stl <10> real stl = HP's 1995 "Standard Template Library" (http://www.hpl.hp.com/techreports/95/HPL-95-11.html). Most of it was adopted by ISO C++, published in 1998, and some of its techniques were later applied to other ISO C++ components such as iostreams and strings. Today, many people (incorrectly) refer to the whole C++ Standard Library or to its full complement of templates as "the STL." <1> most professors have no goddamned clue <3> Oh <0> i'm tempted to say that that's semantics :P <3> So STL should NO LONGER be mentioned, as it is part of STD? <2> It's *mostly* part of the standard library, not completely. <1> std::vector<> is NOT STL <3> Should I see if I can do this course with another teacher?! :P <1> it's part of the standard library
Return to
#c++ or Go to some related
logs:
cum sa floodezi #apache #AllNiteCafe reddiena #linuxhelp ameritrade examancer #london #AllNiteCafe #linuxhelp TARGOVİSTE GİRLS
|
|