« first day (698 days earlier)      last day (4236 days later) » 

4:00 AM
Notice the difference: In the given example, we had a single char named foo. In my example, I used the string literal "a" (which allocates as two chars: 'a' and '\0' or number zero).
That was stored as bar.
We could also do: char arr[2]; arr[0]='a'; area[1] = '1';
arr is a two character array on the stack frame itself created at runtime.
arr, bar have equal strings, but different locations. char foo is NOT an array and is NOT null terminated.
Chat would be so much easier with a whiteboard...
 
yea :D
are you done :)
 
Until you tell me what you don't understand :-)
 
I understanded everything really nicely from you, thanks :D
 
Is that a 'don't talk any more or my head will burst' or 'yes, I actually followed that'? :-)
One more thing: Skip c-sytle strings and go directly to std::string ;-)
 
@JonathanSeng I actually did understand it :D
@JonathanSeng I did that, but i had problems in understanding when using command line arguments. I thought all char pointer pointed to const values
@JonathanSeng just double checking, a string literal is anything that shows up in my code and i between 2 "" right?
 
4:18 AM
yes.
thats probably the simplest way of saying it.
const is only as you apply it.
the typical main function is int main(int argc, char**argv)
Which means the compiler will allow you to change it (to your peril I might add).
char** argv is dynamically created for you array of char*s to fixed sized arrays of chars that are each null terminated.
for(int i = 0; i < argc; ++i) { cout << argv[i]; }
 
0
Q: Why won't for(true;true;std::cin>>str) work?

JasonSageI know I can input text from the console using while (std::cin >> str). When I try the following as an equivalent for loop, I get an unhelpful error in Visual C++ 2010. Why is this technically incorrect? for (true; true; std::cin>>str) { // Get input forever }

 
@JonathanSeng You are new here, you seem nice
Im going to ask something not related to the language itself. School is starting soon, what is the best way to not forget the language and make time to continue learning?
 
Use it.
Find an open source program you use and figure out how to edit it.
A long time ago, I was fixing bugs and adding feature to one or two instant messanger clients I used.
I worked on an open source game server -- which is where I actually got started
Thank you. I try to be nice.
Sorry for the delay, I was posting a response to that question just echoed in here
 
4:33 AM
Great idea thanks and dont worry about the delay. :D
@JonathanSeng You are too nice, you must be new here
 
Thank you. I wish you luck.
 
Thanks :) Are you a CS graduate?
 
Actually, no.
I have a BS in Mathematics with minors in CS and Physics.
 
Epic :D
now tell me
Tau vs Pi
 
I have 13 years of software development experience and have even written and delivered a C++ course to non software engineers.
Eh?
 
4:39 AM
@JonathanSeng nice: :D , I was asking what is better tau or pi?
 
@JonathanSeng Tau is just 2Pi.
 
I have never heard that debate. Googling it now.
 
It isn't worth it.
It's just to make "math easier" or something
 
@Rapptz Everything Should Be Made as Simple as Possible, But Not Simpler -Einstein
Maths should be as easy as possible.
 
You know, if there is a solid argument, fine.
After tau = 2 * pi, I don't care.
 
4:42 AM
They say you cant square root a negative number, invent imaginary numbers etc..
 
I do care, however, about tau out of nowhere.
 
I think I know where Mohammed is getting this from.
 
@Rapptz again?
 
Unfortunately.
 
@JonathanSeng check the video Rapptz posted
 
4:43 AM
any one have a ball park when OpenCL will support DMA for fpga's?
 
@Rapptz Very convincing video
 
Didn't convince me lol
 
Who the fuck cares about a factor of two? Sorry, but if multiplying something by two somehow makes you understand things that didn't make sense before, you're an idiot.
7
 
She does seem to make good pies though.
 
@FredOverflow Why complicate stuff that can be simpler?
 
4:46 AM
because e^iTau = 1 isn't pretty.
 
I'm with FredOverflow. I don't care.
If you rewrite the books because the Math PhDs say so, go for it.
Otherwise, kill the bandwidth.
 
@JonathanSeng Why did you choose C++ (and not some other language) for non software engineers?
 
@Rapptz @FredOverflow @JonathanSeng tauday.com
 
C++ 4 life?
Don't do that.
 
@FredOverflow That was what we used and what our new non-software engineers (like aerospace engineers) needed to learn.
 
4:49 AM
The use of Tau would indeed have removed a lot of random factors of 2 from a lot of equations. But conventions stick. So Pi isn't going anywhere.
 
@JonathanSeng Whoa, C++ going into space? Cool :)
 
@Mysticial We draw a circle by its radius not by its diameter so tau should make alot more sense
 
@MohamedAhmedNabil When was the last time you drew a circle? ;)
 
Last night, with my daughter ;-)
 
@FredOverflow 2 hours ago
 
4:52 AM
Drawing circles is FUN.
 
@MohamedAhmedNabil Are you in Geometry/Trigonometry?
 
Oh man. That lines video.
 
@Rapptz Its a small summer assignment that i wanted to finish up. And here we dont choose our classes. I take geometry, trigonometry, algebra ,statistics etc...
 
I still don't know how to do that. I remember trying after seeing it but failed.
 
4:55 AM
i gtg all
cya
 
@Rapptz Depends on pressure, angle and velocity, one would think.
 
I somehow ended up here.
 
Good night, Mohamed
 
Ah I see the trick now. Interesting.
 
@JonathanSeng good night :)
 
4:58 AM
And I too am heading out.
Good night all you comedians.
 
I'm out too.
Bye guys.
 
night
 
 
1 hour later…
6:16 AM
Can I pas a native handle to boost::thread ?
 
7:01 AM
all dead?
 
nope
just doing work. nothing to say
 
oh lol
 
that's usually the case for me.
Working and lurking.
 
right
that rhymes
 
Morning
 
7:12 AM
evening
 
@NeelBasu what is a native handle? Read the docs for said native handle. Anyways, you can always pass anything. Whether it is wise to do so, depends on how you use it. GUI resources are best kept on 'the UI thread'. Others obey simple laws of physics: they can only be in one place at a time, so, by all means, pass it if the thread takes ownership of that resource.
 
@sehe I think it was meant as a constructor argument to an actual boost::thread object. Not the abstraction.
 
@LucDanton Hence the 'what is a native handle'?
 
mornin'
 
The docs for boost::thread would be more relevant.
What's the point of figuring out what is a native handle if there's no constructor that cares for it?
 
7:19 AM
wow, just thought firefox had lost all my open tabs
 
@jalf Let me guess. You opened a fresh TopLevel window
 
@sehe yep. And then closed the windows in the wrong order
 
Well I just know that std::async accepts anything, and it uses std::thread underneath. Is it that much different from boost::thread?
 
Yes, but that's not relevant.
 
turns out you can just go history -> recently closed windows -> ..., and it's back to normal
 
7:20 AM
@jalf Oh. Luckily there is the 'recently closed tabs' history (Ctrl-Shift-T IIRC, ICBWT)
 
@sehe yeah, not just tabs, also windows
 
@LucDanton Assuming you got the question right. Let's just see whether @NeelBasu is still interested in clarifying at all
 
so got my 90-tab window back with a single click :)
 
talk
 
@jalf Click? Jooz da keebored!
@daknøk Doing that
 
7:21 AM
I want bacon.
@sehe inb4 right animal
@sehe It wasn’t a command.
 
@daknøk It was a verb conjugation that, out of context, could be taken as an imperative. I'm aware of other meanings, but don't blame me if you chose to be ambiguous :)
 
It was rather my species’ utterance.
 
@daknøk You utter just '(tôk)' ?
Good morning, btw
 
Goede morning.
 
I think I was right in calling 'sample bias' the other day...
 
7:24 AM
I want milk and noodles.
 
I want more money
 
I want your money.
 
You don't know much about me, then
 
I know.
Today at school we have programming lessons. Fun! Correcting the teacher while learning nothing!
 
The sense of entitlement on Stack Overflow amazes me sometimes. I just don't know how to get through to people... http://stackoverflow.com/q/12389345/22656?stw=2
2
@daknøk Don't assume too much. Keep an open mind.
 
7:27 AM
hi guys
oh, the new topic is surprisingly accurate
 
room topic changed to Lounge<C++>: Laptops are horrible. Except for MacBooks. [c++] [c++11] [c++-faq]
FIXED
 
Yours broke?
 
@sehe lol, nice...
 
@daknøk i hope it's just a troll.
 
@Mysticial The comment thread is really beyond my wildest expectations, even from that obvious introduction by the Skeet
 
7:30 AM
@BartekBanachewicz The room topic is always a troll.
 
yeah, that needs a star...
 
anyways, i am waiting for my 2 brand new 24" screens. Screw laptops
 
and favorited to add to my collection of hilariously downvoted posts.
 
@sehe I believe that will just fall on deaf ears
 
@Mysticial do you mind posting a screenshot? It’s deleted…
 
7:32 AM
hai
 
@thecoshman Or just troll ears. Morning pirate
 
@TonyTheLion hey
 
@daknøk ¬_¬ trollololol?
 
@TonyTheLion Hi there.
 
@daknøk gimme a sec
 
7:32 AM
@sehe Morning face-palm
 
@Mysticial Don't forget to get a screenshot of the comments too.
 
@thecoshman You liked it?
 
indeed, morning all :D
 
Oh, I get it now. You refer to my avatar. I keep forgetting people have avatars, including me these days
 
7:34 AM
@Mysticial Awesome & your screen is really high.
 
@sehe like what sorry? the face-palm was a reference to your ava... oh, you got it :P
 
two screens actually
 
Ah. :p
 
10 hours ago, by sehe
in C#, 31 mins ago, by Kyle Trauberman
user image
 
@daknøk There's also a tool that will let you take screenshots as though you had a huge screen. There was a question about it on Super User or something.
 
7:35 AM
@sehe lol
 
Man, that question is terrible.
The user should be permabanned.
 
Oh and it's +3/-29. I forgot to expand that.
 
@Mysticial do you have them pivoted?
 
Votes are skewed (or reputation?).
 
@BartekBanachewicz pivoted?
 
7:37 AM
@Mysticial rotated vertically to vertical orientation
 
@BartekBanachewicz no. I have a 1680 x 1050 on top of a pair of 1080ps.
 
Rotated around the Z-axis.
 
@Mysticial on some sort of custom stand?
 
I have 3 x 1080ps all side-by-side. And I have a 1680 x 1050 on top the center and right monitors.
@BartekBanachewicz No, the top monitor sits on top of drawer.
 
@Mysticial that's exactly what I have. :D
 
7:39 AM
the 3 x 1080ps are all on a fold-up plastic table
 
@Mysticial woah, that's a lot. I thought 2x1080p is too wide
 
fold-up plastic table?
 
I'm getting 2x1920x1200
 
anyways, almost 3am here. I'm off to bed.
Need to get up early tomorrow and whore for 17 upvotes to get my rep back to a multiple of 5. :)
lol
 
7:43 AM
damn guy
I think in the new year, I shall save up my pennies, potential push back learning to drive yet longer, and splash out on a beefy PC
 
Shall I bring a pillow to the HTML lessons today?
 
probably then tart up my current one to use as a bit of a server
@daknøk to smother your self with?
 
@thecoshman to sleep.
 
@thecoshman no only the four hours that lesson takes.
 
7:48 AM
but seriously, you best pat attention. Whilst the lecturer is bound to be talking shit, it is the shit that he will be expecting from you, play the game man
@daknøk for hours for 'use a cms?' (poor joke)
 
How is that related to CMSes?
 
LOL. Just got nice story from a colleague. Some guy stole a phone from a polish tourist in barcelona. The original owner had automatic dropbox file post, though - now he has a lot of the thief's photos and his family ^^
2
 
hahah
 
@daknøk ¬_¬ don't arse around with HTML shit, just use a CMS, jobs done
 
hehe :p
But when you need to add custom functionality to a CMS (i.e. just write a new CMS), you need knowledge of HTML.
Non-custom CMS-es suck by definition.
 
7:56 AM
@daknøk meh
 
But yeah I don’t prefer web development.
Maybe server-side stuff.
But client-side is boring as fuck.
 
@daknøk exactly the kind of logic why kyrostat is not a finished site :P
 
hehe :p
Write Kyrostat in Haskell.
 
@daknøk nice idea, except we were aiming to make something
 
Well said; “were”.
 
7:59 AM
I do intend at some stage to do more work on it, I just have other things distracting me :P
 
distractions eh
plenty around
 
like iPhone 5
 
iPhone 5 is fugly.
 
Iphone 5 is overrated
 
8:00 AM
@BartekBanachewicz bah, hardly
 
The camera is not in the vertical center of the shiny stroke, and that is ugly as hell.
 
the connector port is a total joke
 
@TonyTheLion still going to sell amazingly well, damn fan boys!
 
@thecoshman yea my FB wall was already full of fanboy posts
 
@BartekBanachewicz So what's the deal with the iPhone 5's connector thingy?
 
8:04 AM
@Insilico It's new. Isn't it enough?
 
@BartekBanachewicz What's wrong with the old connector?
 
@Insilico Nothing. That's the point.
 
@BartekBanachewicz Sounds like business as usual at Apple Inc.
 
There was a Wii U conference.
Pretty neat.
 
@Insilico what does it matter? this is NEW
 
8:07 AM
@thecoshman ZOMG NEW CONNECTORS.
 
just look at the lack of NFC, it's basically just so they can wait about half a year to release the iPhone 5N, slightly thinner and with NFC!
 
@thecoshman And by slightly thinner you mean 0.0001" thinner! :-P
The digital calipers I have on hand can't resolve 0.0001", so perhaps 0.0001" might be pushing it.
 
¬_¬ I am all for using inches for stuff... but god damn why can't you just say '0.5 mm'
 
@thecoshman Because that was the mode my digital caliper was in when I turned it on. :-P
 
@thecoshman +!
 
8:16 AM
Next time I'll try to provide unit conversions. If I don't feel particularly lazy that day.
 
@BartekBanachewicz do you mean '+1'?
 
@thecoshman I meant it originally but I figured out "+!" is even cooler
Like 20% cooler
 
@BartekBanachewicz more like 20% stupider
 
Stop implying that stupidity cannot be cool.
 
8:23 AM
Use the thermostat on the airconditioner
 
@daknøk I am not implying it, you are inferring it
 
So many big words. My head!
 
fuck
I had a really annoying sleep
 
Recently had the worst sleep in my life as I was experiencing vertigo when lying down.
 
were you drunk?
 
8:36 AM
So anyone has tried VS2012 Express?
 
@Blank I'm using it for about two months
ah, express. Ain't much different if you don't care for plugins. Or profiler, dunno, haven't used express for ages
 
@BartekBanachewicz Is it worth giving a try?
I find express good enough for my work.
 
@jalf No.
it was one of those times where I hadn't slept well recently, so I went to bed early, except then randomly after about 6:30am I kept waking up
possibly because of the construction work on the house :P
 
@Blank If you are using older version i see no reason NOT to upgrade
 
Currently I have VS2010 Express
As for using, I don't use VS, neither this one I am gonna ;)
 
8:41 AM
@DeadMG I meant @StackedCrooked :)
 
lol
 
hai puppy
 
So the VS2012, comes bundled with VB and C# crap as well.
Any way it can be C++ only?
 
@DeadMG Have you heard anything from the companies?
 
@Blank Get the VS C++ Express edition? :-P
I think when you install VS2012 you can pick which compilers to install.
 
8:48 AM
not yet
 
So, my compilation is not halting.
 
@Insilico That should be fine then.
 
I attempted to compile variant<int, recursive_variant&> v = 0;.
 
At least when I installed some prior edition of VS I'm pretty sure I remembered seeing a screen that allowed me to pick what "parts" of VS I want, and I pretty much picked only C++ tools.
 
@BartekBanachewicz unless you want to target Windows XP. Then you can't use VS2012 /cc @Blank
 
8:49 AM
Or maybe I remembered wrong. Don't quote me about the VS installation process.
 
@jalf False. You can install older Windows SDK and use it seamlessly
@Blank Yea, you can pick what you want
 
@BartekBanachewicz The other way is also possible. I've had newer SDKs work just fine on older VS installations
 
@BartekBanachewicz but then you lose out on the VS2012 compiler features
 
Anyway I will keep 2010 as well.
 
@jalf As if there were any "features" :P If OP was using 2010 previously, he isn't "losing" anything
 
8:52 AM
@BartekBanachewicz didn't you just say that you saw no reason not to upgrade?
Now it's "there are no new features, and if you want to be able to do what 2010 could do, you'll have to install another compiler side by side"
 
@jalf Yes. He can keep using the old toolkit, getting new editor and stuff. So it's pure gain
 
if I have a class that contains a std::unique_ptr which requires a custom deleter, should I write the deleter as a member or non member function?
 
@jalf which weights about 200MB. OMIGOSH
 
@BartekBanachewicz whooosh /me watches the point fly past you
 
@jalf New editor! Better navigation! Faster in general! And you can use new features if you want to target new systems
 
8:54 AM
@TonyTheLion I usually make the deleter a nested, private type.
 
@BartekBanachewicz 200 MB is nothing in the age of 1 TB hard drives available for less than $200. :-P
 
@Insilico I'd say less than 100$
 
@LucDanton a nested struct with operator()() overloaded?
 
@BartekBanachewicz For decent ones? (Assuming MSRP)
 
@BartekBanachewicz ah, see, that's what I was looking for. Not nonsensical statements like "there are no new features, and you'll need a secondary compiler installed, but there's no reason NOT to upgrade anyway"
 
8:55 AM
@TonyTheLion Yes. This means that the definition of such a type must be visible in the enclosing definition, but the definition of operator() doesn't have to.
 
Just started the installation. Must say the UI is rather new and refreshing :)
 
@Insilico I can get a seagate in Poland for about 100$
 
@Insilico who buys 1T? if you are getting a big drive, get a big one!
 
@thecoshman i am getting 1TB
 
@BartekBanachewicz don't waste money, get a 3T
 
9:02 AM
@thecoshman I don't need 3 Tb
 
@BartekBanachewicz you will
harddrives always fill up :)
 
Unless you do some clean up
 
@jalf unless you stream everything
 
Now that I have booted windows, I am cleaning it with C-Cleaner.
 
no, it's a universal law of nature: however much harddrive space you have, it fills up in next to no time
 
9:06 AM
Do you use the "Registry" cleanup with CCleaner?
 
@Blank I wouldn't dream of it. Pure placebo effect. Broken bandaids for the brokenness of Windows doesn't make Windows any less broken
 
ah
 
IMO, anyway
but really, the registry contains hundreds of thousands of keys already. Running an application which cleans out perhaps one or two thousand keys isn't going to change anything, and you run the risk of deleting something that was actually necessary
The registry is fucked up no matter what you do
 
sad but true
 
@BartekBanachewicz *yet FTFY
 
9:15 AM
@thecoshman I don't keep stuff on my HDD. I just let the stream flow
 
how would you deal with an error occuring in the ctor, while initializing the object?
throw an exception?
 
Yes.
 
@LucDanton is it save to throw from ctors?
 
@BartekBanachewicz yes, it's the only sane way to report errors from a ctor
it's tricky to do in dtors, but in ctors it's fine
 
9:30 AM
okey
 
The language is designed to make it work. There are considerations, because you need RAII to make use of exceptions sensible. But that's not restricted to constructors, it applies to everything.
 
sbi
yesterday, by sbi
@CatPlusPlus He's a bloody amateur.
 
I somehow managed to make variant<int, recursive_variant*> work but not variant<int, recursive_variant&>. I'm stumped.
 
struct addrinfo_deleter;std::unique_ptr<struct addrinfo, addrinfo_deleter> server_result;
The compiler complains about my deleter being undefined. I have defined it in the .cpp file, not in the private declaration of my class, I just put it as above
 
@BartekBanachewicz s/save/safe/
 
sbi
9:41 AM
@BartekBanachewicz Their ability to report an error from a ctor was a major incentive behind introducing exceptions to C++.
 
@sbi what does "incentive" mean?
 
@BartekBanachewicz a reason to do something
"the incentive Jimmy was given to clean his room, was that he would get doughnuts"
 
thanks.
btw, my screens are waiting for me to pick them up, yay... Too bad I have to sit there for a few more hours -.-
 
look at me, giving English advice
2
 
like a sir
 
sbi
9:48 AM
@BartekBanachewicz An incentive is that carrot dangling in front of your mouth.
 
@sbi I thought of going with that analogy as well :P
 
@TonyTheLion If by deleter you mean the addrinfo_deleter type then it must be defined. Only addrinfo_deleter::operator() can have the luxury of not being defined.
 
sbi
@thecoshman In fact, Leo translates "incentive" into (among others) "Anreiz", for which in turn it gives, among others "carrot". That had me thinking for a second or two, until I grasped the idea.
 
@TonyTheLion An alternative is to user-provide the destructor. Let me write you a demo.
 
@sbi schwah?
 
sbi
9:51 AM
@thecoshman Uh?
 
I'm laughing more than I should
 
@sbi you saying "Inventive"English -> "Anreiz"German -> "Carrot"English?
@LuchianGrigore how many has @Sbi seen? NINE! SCNR
 
sbi
@thecoshman No. I said "incentive" (English) => "Anreiz" (and others, German) => "carrot" (and others, English).
Note the "c" where you have a "v".
 
oh yeah :P
 
@LucDanton I fixed that, thanks :)
 
9:54 AM
Nine nine nine!
 
so, is 'Anreiz' one of those words that does not translate directly to something?
 
But now this is causing me an issue. Why can I not pass &foo_ptr to my init_foo?
 
sbi
What's that joke with "nine" all about? It went right over my head.
 
-1
Q: Simple C program - please explain output

hitesh.inceptint main(){ int a=7, t=0; t=--a+--a+a+++a; printf("%d",t); } output: 20 I could not understand why it prints '20' ? please explain it !

close votes
 
@sbi It was a reference to the scene with Hitler getting frustrated
 
sbi
9:55 AM
@thecoshman It translates directly into "incentive" and others. (There rarely ever is a word that has only one translation.)
 
@sbi nine in English is the number, in German it is no. You have seen 'nine' cocks... High larity ensued
 
I think.. except using numbers..
 
sbi
@Neil "the scene with Hitler"?
 
@sbi Let me find it then.. there have been a thousand parodies of it
 
@TonyTheLion Mmh, I was wrong, there is no such second alternative. So I guess you don't need a demo!
 
sbi
9:56 AM
@thecoshman Actually, "nein cocks" wouldn't work in German. It would have to be "keine" ("none").
 
@Neil to the scene?
 
@sbi oh, but nein is 'no' right?
 
sbi
@TonyTheLion Because the address of a smart pointer is not the same as the address of a dumb pointer?
 
and keine would not work, as the 'humour' lies in the fact that the words are homophones
 
sbi
9:58 AM
@thecoshman Yes, but those two are not 100% congruent in their meaning. While you can say "no cocks", you cannot say "nein cocks". Well, you can, but it's wrong.
 
Nor that of a moderately intelligent pointer....
 
@sbi just lol would ya :P
 
0
Q: Initializing a std::unique_ptr by passing the address of the pointer

Tony The LionI am creating a class which interops with some Windows API code, now one of the pointers I have to initialize is done by calling a native function which initializes it. My pointers are of type std::unique_ptr with a custom deleter, which calls the WinAPI deleter function provided, however I cann...

I've created a question with an example
@sbi Well I've figured that this may be the case.
 

« first day (698 days earlier)      last day (4236 days later) »