| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> Yeah, I've been going to bed at 5:30 am lately <1> i'm off as well <0> For some reason <0> So trying to readjust <0> Night <2> anyone tried winternals as data recovery software ? <3> pretty big problem here, calling a constructor that has an argument and then calling the basic constructor (the one that has no argument, just nullifies pointers and such). when the basic constructor returns, my deconstructor gets called. why? <3> ex: cl*** foo { foo() { } foo(bool bin) { foo(); } }; <3> shouldnt it run just like a function would? <4> uh <4> what? <4> you're calling foo() within foo's constructor? <3> yes <4> seems pretty pointless <3> i dont want to repeat code for each constructor <4> you understand that creates an unnamed object of type foo, then detroys it, right?
<3> WHAT?! <4> what would you expect it to do?! <3> just call the code and return the the constructor <4> no, you called a constructor <4> constructors create objects <4> well, not really <4> but that code sure does <3> a ctor is just another type of function <4> not really <3> how does it differ? <4> it's a constructor, that's how it differs <3> thats a redundant answer <4> shrug <5> so how does that apply to derived cl*** constructors calling base cl*** constructors? <5> same thing? <3> no, it calls it correctly <3> only itself it does this <5> ah, thats what i figured. fun little quirk <4> of course it does <4> what quirk? <4> there's no quirk <4> foo f; creates an object of type foo <4> foo f(); does too <3> so where does this nameless object go once its created? <4> foo(); does too, except you didn't give it a name <4> it gets destroyed <3> i see <3> that changes my whole outlook on c++ <4> why? it shouldn't <4> unless you were looking at it wrong <5> so then your foo(bool bin) { foo(); } would be (almost) the same as foo(bool bin) { foo myfoo(); } <4> yes, almost <5> neat, good to know <4> void f( foo f ); f( foo() ); same idea <3> well, i've got an idea. i'll try a "this = foo();" and add some operator magic <4> no <4> no no no <3> to copy over the members <4> that would be a really stupid thing for you to do <3> why? <4> because it doesn't make any sense <4> what are you really trying to do here? <4> there's no need for 'magic' <3> var *bool; foo() : var(NULL); .. foo(bool bin) { var = new bool; *var = bin; } <3> i want to call foo() to set the var to NULL <4> new bool ?! <3> eh, an example <5> gotta conserve that memory for runtime <3> bool *var; ^^ <4> how about <4> showing us what you're REALLY doing <4> so we can solve the actual problem, not something you think is related <4> paste your code to the paste site <3> well, i know for a fact that this IS the problem. and its not homework or a <= 100 line program <4> the problem is that you have a member of type bool* and you're p***ing a bool to your constructor? <3> but i understand now more about what c++ does with its constructors, should be able to figure some things out <4> I don't think you do <4> where are you learning C++ from? <3> self taught ages ago <4> well, then you're all sorts of screwed up, for sure <4> and learning from the web is a Bad Idea
<5> thats how you have to do it when you have no money <3> seems to be working for me so far =) <3> oh i have books and such <4> doesn't look like it's 'working' to me <3> few credits in some ****ty college courses <4> that probably does you more harm than good <4> our only recommended books are here: http://www.rudbek.com/books.html <4> you probably should make use of the initializer list for initializing members in your constructoor <3> instructors like to get you to use outdated compilers with graphic libraries that no respectable software company would use <4> that's correct <3> i do use the initalizer list, religously.. i just dont want to have to repeat it for each constructor i create <4> how many constructors are you planning on having? <5> how many are you making? macro it or something <4> no, don't macro it <3> between 1 and 6-7 per cl***.. lots of cl***es <5> c++ programmers love macros <4> listening to _setsuna_ is a Bad Idea too <6> setting a pointer to = 0, means that when I call "if ( m_pSelected )" that it will be null? <5> i agree wholeheartedly <4> tehxeer what are you writing?? <3> c programmers love macros, i dont <3> oh, its a tivo =) <3> oo'ed and portable <4> i see <6> Does setting a pointer to = 0, means that when I call "if ( m_pSelected )" that it will be null? <4> no, PFloydMSQ, it means that m_pSelected will evaluate to false in that context <4> i mean <4> that's only if you set m_pSelected to 0 <4> not just "a pointer" <4> and that's only if m_pSelected is actually a pointer <4> anyway, off to bed <4> tehxeer, get Accelerated C++ and sin no more <3> thanks for the help rdragon, will do <7> hello <7> please how to do in Vs Pro to make the program i make work in peace on every comp without any installation prj ? <8> Does that include the ability to run it on the ENIAC? <9> "every comp" <7> i mean <7> every windows Xp compuer <7> anybody can help <7> <8> Which version of VS? <7> 2005 <8> Well, anything compiled on it will run on any xp machine, provided you have all the needed ***emblies / libraries on that machine. <8> So for example if your app requires a version of mdac to run, then it'll have to be on that machine. <8> btw the whole point of installers is to remove that uncertainty. <7> IRR no <7> if i run my program <7> a super simple hello word program <7> in a comp where VS2005 is not installed <7> it wont work <8> You know why? <7> no <7> its by every body like <7> that <8> Because you don't have the .NET framework installed on that computer. <8> Which is needed to run most apps developed in VS 2005 <8> Well with VS 2005 you need the framework v 2.0 <7> no way to go around that ? <8> nope <10> try dev-c++ <7> javaq_ what is that ? <11> hey all <7> please where can i get some real help about using .Net in Visual Studio 2005 ? <12> bittorrent has loads of books on .net <7> cant a struct have a constructor <7> ? <13> no <9> yes <13> yes to my no or yes to structs having constructors? <13> starship troopers could make real cool serious if some viewers had a taste for sci-fi art :\ <14> the book was way better <14> heinlein i believe <15> the book was way better
Return to
#c++ or Go to some related
logs:
#mirc #linux megadeth disconnect.mp3 #skype skiiny naked #squid #linux #c++ carderi #linux
|
|