| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> sigh <1> I watched green acres when I was a kid, dopey <0> sure sure <1> bleh <0> looks like vista beta 2 borked over rdp, well done <2> windows really **** <2> 9GB <2> is that the required disk space right? <2> for windows vista? <2> or 15GB <3> who cares <2> if not bcoz of programming <2> i should stick to my Mac OS X Tiger <3> use real english, I'm tired of this z **** <3> do whatever you want <2> ok
<0> now to see if they've fixed the ea downloader so that it doesn't depend directly on IE6 for some godforesaken reason <4> is there a "list view" mode for windows explorer in vista? <0> what do you mean <4> like files are organized top to bottom and left to right <4> and only scroll horizontally <4> unlike detailed view that scrolles vertically <0> i don't see one <4> thats enough to make me want to uninstall this piece of **** <4> god damn micro**** <0> okie dokie <4> whats "sync" for? <0> likely the next version of activesync, for partnering with mobile devices, cell phones, pdas, etc <0> good, ea did fix the ea downloader <0> so that it works on systems without ie6 <4> electronic arts? <0> yes <4> is it just me or did everyone else have to reinstall office? <4> those that upgraded and did not clean install <0> who knows <0> i'd never upgrade, especially on a beta os <3> peterhu do you use codeplex ? <0> haven't yet <0> i registered but that's it <3> I just registered, but it won't let me connect to their team server <5> hello <5> i am interest of cee plus plus <6> cee? Heh. <7> c33 <8> you see <9> if you instantiate a variable inside a loop, does it create a memory leak or does the scope of the variable end with each iteration? <10> the scope ends <10> better said when the scope ends the variable is discarded <9> after each iteration, or after the entire loop exits? <9> you're saying after each iteration right? so while(...) { int i = something; } is valid <7> That i is unique <7> As far as I know, it would very likely utilize the same memory space for all the i's in the loop <7> But it would refresh that memory at each iteration, meaning that they're genuinely different variables. <7> The scope is cleared at the end of each iteration, let's say. <8> aldr0n : however, if your variable is of a custom cl***, and has constructor and destructor - it's a very good idea to declare it outside the loop, unless you need it to be constructed and destructed every time <9> I'm just saying I had previously thought it created a memory leak to instantiate a variable inside a loop, until it occured to me just now that the scope would end <7> No, won't cause any problem at all. <7> It's not even a particular performance hit. <9> I understand now. <7> Try it in a loop of 4,000,000. <7> Now, dynamic memory is a whole different ball game. <8> JBlitzen : if the ctor is heavy - it is a performance hit <7> Obviously when you new something inside a loop, you'd better be on the ball. <7> exception, he's talking about ints, I ***ume he understands the difference between utilizing simple data types and complex data types <9> well I need the value to stay the same, so I'm going to use the { } to make a temporary scope to intialize the var, then use it inside a loop <9> yeah i'm not newing anything there <9> well actually I am but I delete it too <7> If you want the value to say the same, declare the variable outside the loop, or declare it as static. <7> There's a relatively simple way to see how this works in practice <8> creating a special scope is pointless - you can declare a variable at any point of the scope <7> for (jlaskdfjasd) <7> { <7> Wait :/ <7> int *ptr;
<7> for (jalksdfjasdf) <8> int X; for (...) {use X;}; <7> { <9> i'm going to use { int var = something; while(var != something else) { var = somefunc(); } } <7> Here's an idea, why don't you all type over me <9> sry <7> int *ptr; <7> for (asdf) <7> { <7> Damn, missed yet another step <7> int *ptr, x = 5; <7> ptr = &x; <7> for (asdf) <7> { <7> cout << *ptr; <7> cout << (double)ptr; // or whatever <7> int y = 23; <7> ptr = &y; <7> } <8> casting a pointer to a double.... you'll get some interesting results <7> That will lead to some very interesting results, I think. <8> aldr0n : why do you use the external scope ? <7> See my point in that code, aldr0n? <9> i think so <7> It should result in gibberish at the second iteration <7> Although the memory address might actually stay the same <7> It would be even more interesting if you try to write to *ptr <7> Should work fine the first iteration, then give a runtime error the second. <7> Because the space it's pointing to at the second iteration is essentially deallocated at the end of the iteration <9> yeah <7> Now why don't you tell us what you're trying to do <9> i think I've got it <9> I was just wondering that about scope <7> k <7> As a general rule, anything inside {} is in a unique scope <7> That's not always the case, and it's not exhaustive, but it's a good guideline <7> Actually, it might always be the case, and it might be exhaustive, but I'm too tired to think about it right now. <7> Interesting! <7> Check this out <7> int *ptr, x = 0; <7> ptr = &x; <7> for (int m = 0; m < 4; m++) <7> { <7> std::cout << *ptr << std::endl; <7> *ptr = 5; <7> int y = m; <7> ptr = &y; <7> } <7> Output is: <7> 0 <7> 1 <7> 2 <7> Press any key to continue . . . <11> [enter] <7> :/ <11> is that unexpected somehow? <11> makes sense to me. <7> I'm surprised the *ptr = 5 was permitted <7> That indicates that each iteration is not in fact a unique scope <11> howso? <11> ptr is declared outside the loop... <12> Heh <9> ptr previously pointed to x at that time, which is still in scope <7> Yeah, and that's right <7> BUT <7> [05:47] <7> ptr = &y; <7> y is a local variable within the iteration scope <11> right, that was just initialized to another local value. <11> and then you point to it. <12> You're just lucky it doesn't crash <11> just because y goes out of scope doesn't mean ptr stops pointing to it. <7> Ignoring NineVolt, who seems to have short circuited, that's my point, ashe. <12> Not sure what's interesting about it, you're only 4 bytes "out of bound" on the stack
Return to
#c++ or Go to some related
logs:
#chatzone #linux #skype #teens What country administers the Caribbean hideaway of Martinique?
HTB: quantum of class 20001 is big. Consider r2q change. #linux #AllNiteCafe #linux #AllNiteCafe
|
|