« first day (705 days earlier)      last day (4234 days later) » 

12:27 AM
@R.MartinhoFernandes What about food?
 
@EtiennedeMartel I think there's enough space in there to grow it.
 
@R.MartinhoFernandes That means you'll have to eat vegetables.
 
I wasn't expecting a perfect life.
 
There may be squirrels in the trees :S
And fish in the lakes.
But yeah, bringing in a breeding pair of cows would be awesome.
 
12:33 AM
@R.MartinhoFernandes An animal eats more than it gives. So it's not productive.
 
Erm, I don't eat grass.
It's efficient because it uses resources that would be wasted otherwise.
 
user406009
But you could plant corn where the grass is.
 
user406009
Or burn the grass for energy.
 
@EthanSteinberg But I don't need to use all that space to produce corn to feed a dozen people.
 
user406009
I thought the whole ethanol thing needed tons of corn?
 
12:36 AM
What do I need ethanol for?
 
@EthanSteinberg Corn is not very efficient either.
 
I'm not driving cars.
It's a zombie apocalypse for crissakes.
I'd rather have beef than ethanol.
 
http://stackoverflow.com/questions/12504710/double-free-error-in-string-operations
Upvote my comment? :)
 
I like how it's very very defensible against other survivors.
And zombies... Well, worst case scenario: they float and we can't use boats.
 
Xeo
HALP!
I found a guy on YT who reviews candy.. and I can't stop watching his vids. @_@
 
12:41 AM
If they don't float we can set up an advanced outpost on shore for thingies.
At the smallest sign of danger, the unlucky dude that was on duty that day isn't allowed entry.
Hmm, apparently there's a tunnel to a village on shore. That may need some collapsing.
 
@Borgleader y
 
The thing was mistagged, OP fixed it
 
Xeo
I do have to admit, he has an awesome voice for this.
Oh, and he's into anime. Awesomesauce.
 
Xeo
1:21 AM
Okay, so he likes Anime, Touhou, Candy...
 
0
Q: Concise way of pronouncing :: in C++?

Emile CormierHow do you pronounce :: in C++ in a concise way?

 
@Borgleader Not sure if that'd suits english.SE better.
I think pronunciation questions are OT for SO.
 
It's not mine. My reaction was "wtf"
I mean... who cares
 
I guess english.SE does take programmer terminology:
17
Q: How to pronounce the programmer's abbreviation "char"

Armen ԾիրունյանIn many programming languages, char is a type name for character values. The word character is pronounced with a [k] sound, but what about char? While trying to find the answer elsewhere, I learnt that there is an English word char which is pronounced [tʃɑ:(r)], but it has nothing to do with ch...

 
1:37 AM
I pronounce char like the Charr from Guild Wars
 
kar
 
I say "car".
 
I pronounce like in this (deleted) question: stackoverflow.com/questions/8462432/how-to-pronounce-char
and that probably means I need to post a screenshot...
 
> I've never heard any native English speaker call the char datatype care or car. It's always pronounced as the first syllable in charming, despite the fact that it's obviously an abbreviation for character.
 
1:45 AM
Really? I guess I'm in that minority of native English speakers that pronounce it "car".
 
Pretty sure that guy is just tossing a hyperbole to make his point seem better.
But yeah, I pronounce it kar because that's how you pronounce the beginning of character so I take it that's how you pronounce it.
 
Xeo
Okay, got myself to stop watching the vids. Time to sleep before I come back to them!
For the record, I'm a "charming" pronouncer.
 
I don't think there's a right or wrong answer though :P
 
Xeo
Aye
 
Nah... Seth's comment is right on. We don't need to pronounce it.
 
Xeo
1:49 AM
@Mysticial You don't have interrnal / external monologues?
 
@Xeo Not when I'm programming, but I do when I'm writing papers.
 
Huh, looks like I'm going to be learning Scheme next year in first year university.
 
I program visually. I type verbally (so you see me mixing up "its" and "it's" a lot.)
 
Xeo
I always read what I write, so I "pronounce" it inside of m head
 
1:52 AM
I read after I write it. And that's when I correct errors like "its" vs. "it's".
 
I always thought char was like it is in "character" until I read Stroustrup's Style and Technique FAQ.
 
@Xeo As do I. It keeps me in check.
It will always be kar for me. Even if Stroustrup says otherwise :P
 
Xeo
Anyways, really beddy time now. G'night
@Rapptz Stroustrup is also just human.
 
night
 
night
 
1:54 AM
Stroustrup is awesome
 
I just got a ping without a message. strange...
 
@Mysticial Now you have a ping with a message. :-)
 
lol
 
@Mysticial hm
 
A study of the basic algebraic systems of mathematics: the integers, the integers modulo n, the rational numbers, the real numbers, the complex numbers and polynomials.
Seriously? I have to take that?
 
2:04 AM
@chris That actually sounds interesting to me. Although I'm not sure how it pertains to CS (with the possible exception of modular arithmetic).
 
@Insilico, But it's so fundamental.
 
Sounds like an easy A you can sleep in or skip.
 
At least my first year will be an easy one on the learning side.
More time to focus on doing a good job with coop.
 
@chris True, but in my experience new students fresh out of high school have a very high chance of bombing their first term there.
I'm sure you'll do fine though. Sounds like you have things in order
 
Well, at least it'll be a good refresher. I didn't take math this or last year since I'm in 5th year atm and did calculus a year early.
 
2:09 AM
You should continue Calculus.
 
@Rapptz, I'm doing that through university, though first year is basically a recap of the one I took.
 
Sup guys
Is a PhD important in computer science?
 
@MohamedAhmedNabil Depends on what you want to do.
 
@Insilico What do people that get PhD's want to do?
 
@MohamedAhmedNabil Not really. Certain careers actually need a PhD, such as Biology, Biomedicine, and other types of sciences. Computer Science isn't one of them.
 
2:17 AM
@MohamedAhmedNabil Research, teaching, academia, typically.
 
Not saying that it's a waste, but it's not "required".
 
Although you don't need a PhD for any of those things.
 
@Insilico A PhD for someone that want to be a GUI developer or a game designer (anything practiacal) isnt required?
 
@MohamedAhmedNabil Oh definitely not.
 
Don't get a degree in something specific like game design. Get a degree in Computer Science.
 
2:19 AM
@Insilico Would it help?
 
@MohamedAhmedNabil It doesn't hurt.
 
@Rapptz There are degrees for game design? What else?
 
@MohamedAhmedNabil There are degrees in pretty much everything you can think of.
 
Hell do I know. There are degrees in a lot of things and 90% of them are a waste of time.
 
@Insilico Is there a master's degree and a PhD in everything as well?
 
2:20 AM
@MohamedAhmedNabil Probably.
 
No
 
I find that Acrobat renders text better, while Sumatra renders pictures better.
 
Why is a game design degree useless?
 
This annoys me, since I really don't want to use Acrobat at all.
 
@MohamedAhmedNabil It's not useless so much as it really limits you to game design
 
2:22 AM
@MohamedAhmedNabil Because if gaming isn't something you want to do anymore due to consistent failure, you're sort of limited.
 
which is such a tiny, tiny part of computer programming.
 
What if i get a game design degree then a GUI development degree for example? I wont be limited then, right?
 
lol
 
@MohamedAhmedNabil No, you'll be limited to GUI development and game design.
(I can't believe I had to say that)
 
@Insilico I was just making sure ^.^
 
2:23 AM
Besides, CS transcends both of those things anyway.
 
So, how does anyone like Scheme? I haven't heard about it so much in comparison to other languages.
 
@chris I've been wanting to try out Scheme for a while now. Just haven't got the time lately. :-/
 
@chris It's essentially the same as lisp.
 
What is C# all about?
Here in egypt that most requested languages are C# and ASP. Why?
 
@MohamedAhmedNabil It's another programming language.
@MohamedAhmedNabil The hell I know. It's just another language as far as I'm concerned.
 
2:33 AM
 
2:54 AM
@chris Scheme is (a form of) Lisp. It started out as a very stripped-down version of Lisp, with a few of Lisp's early gaffes corrected. Most of the gaffes have been corrected in mainstream (Common) Lisp now too, but Scheme is still a fair amount smaller and arguably still somewhat cleaner.
 
Correct me if I'm wrong
!!x == x
 
@Borgleader You're wrong.
int x = 2; assert (!!x==1);
!!x converts x to either 0 if it started out 0, or 1 if it started out non-zero (i.e., converts to Boolean values, based on C's idea of true/false).
 
Ahhh right
I was thinking outside the programming world and I cancelled them out
@Mysticial: Elegant answer :) Simpler than what he had.
 
I think my answer has undefined behavior if x = -2^31.
Signed integer overflow on the negation...
damn...
 
3:09 AM
Is the DEFLATE compression algorithm parallelizable?
 
http://stackoverflow.com/questions/12505563/best-way-to-return-a-class-in-c/12505608#12505608
Not to dig out my Scott Meyers book to verify this before I get downvoted to oblivion
 
@Borgleader You can mention that the optimization has a specific name: Return Value Optimization.
If the OP cares to do any further research on it
 
Good point :)
 
So, I found something interesting today. Has anyone ever experienced a 320x200 screen resolution?
 
@chris I have experienced such a screen resolution on cell phones made last century.
 
3:17 AM
I'm talking about monitors.
 
On my gameboy pocket when I was a kid
but not on a PC
 
Well, apparently, as I found out from EnumDisplaySettings, our school's monitors support it.
 
How old are they...
 
It isn't listed on the Intel card software's list or anything.
Pretty old.
I couldn't resist trying it of course. That was a mistake.
You literally can't see or do anything. The start button takes up like 1/4 of your screen (XP).
 
rofl
 
3:20 AM
Right now I'm trying to see if libpng will create a 165888 x 65536 pixel PNG that has a checkboard pattern on it (2048 x 2048 squares). Apparently libpng is not multicore aware, as it pegs the quad core CPU machine it's running on at only 25%
 
Any of you heard of the book "The Are of Readable Code" ?
 
But I have it so that my res goes to 1280x1024 (instead of 1024x768) when I log in, so that was fine. Restarting also reverts any changes there.
 
@Borgleader I've heard of "The Art of Readable Code".
 
I read it this summer. It was pretty good. I was curious to see if anyone else had heard of/read it
I actually came across it from a tweet by John Carmack. All it was was a link to amazon
 
@Borgleader no but i've heard of tex. has anyone tried to access the documentation, apart from knuth himself?
 
3:28 AM
tex?
 
@Borgleader The software that LaTeX is based on.
TeX ( as in Greek, but often pronounced in English) is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as . Together with the Metafont language for font description and the Computer Modern family of typefaces, TeX was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give exactly the same results on all computers, now and in the future. TeX is a popular means by which to typeset complex m...
 
Oh that, yes. But the book is also about structure your code in a way that it is less confusing and points out a few cases where good variables names turn out not to be as good as they first seem.
 
@chris I suppose I'm showing my age, but yes. On the original VGA that was the highest resolution 256-color mode that was officially supported (mode 13h, to be exact). There were also, however, various unofficial "Mode X" resolutions that went up to 360x480 in 256 colors, if memory serves.
 
@JerryCoffin, Yeah, I haven't had to live through that. The only difference is that back then, the displays weren't meant to be on such higher resolutions, so trying to put Windows XP on that resolution really killed it.
 
0
A: c++ creating "shortcuts" macro-like definitions

Cheers and hth. - AlfAsking for easier way to do something dangerous… Yes, there are a lot of ways to accomplish what you ask for, including C++ template, macro definition, editor shortcut, custom preprocessing, trained monkey that fixes up the code. But all you accomplish is to make your code even less g...

^ Yay, I answered a QUESTION! :-)
Ungood: unable to participate in next meeting of Oslo C++ Group, since I'm up north.
Coffee: pretty cold, maybe fix another cup.
 
3:41 AM
@Cheersandhth.-Alf It's a good answer to a question that doesn't give a lot of details.
 
The OP's question smells fishy to me anyway.
 
@chris It's less a matter of displays than the software. By the time XP came along, they pretty much assumed 1024x768 as a baseline, and drew border widths (and such) on that basis. 320x200 was mostly games, but even at the time it was pretty low res (thus the use of Mode X to get 256 colors with more resolution).
 
I'm just playing old 80's music, now Spandau Ballet.
I wonder if the swastica on the cover means they were really neo-nazis or what?
 
It's one of those questions where it's like "If you think you have this problem then you probably have even bigger problems that you need to fix first."
@Cheersandhth.-Alf Which way is the swastika "spinning"?
 
3:42 AM
can't rememeber. wait
 
I also answered that question, took me a while because I wasn't sure my example would compile so I opened VS2010.
 
@JerryCoffin, The first part is what I meant to say. The software graphics were meant to be displayed on lower resolutions.
 
@chris Oh, sorry -- I thought by "displays" you meant "monitors".
 
3:45 AM
http://stackoverflow.com/questions/12505796/close-a-browser-with-php
HA that picture is just great
 
@JerryCoffin, I know. Poor wording is great for saying the opposite of what you wanted to.
 
@Cheersandhth.-Alf No, not neo-nazis. Just idiots (in case it wasn't obvious, I wasn't a fan).
 
ah
@Borgleader is that from the fugitive movie with harrison ford?
The Fugitive is a 1993 American thriller film based on the television series of the same name. The film was directed by Andrew Davis and stars Harrison Ford and Tommy Lee Jones. The story opens as Richard Kimble (Harrison Ford) is wrongfully convicted of the murder of his wife. Soon after, Kimble escapes from custody and sets out to prove his innocence and bring those who were responsible to justice whilst being pursued relentlessly by a team of U.S. Marshals, led by Deputy Samuel Gerard (Tommy Lee Jones). The film garnered critical and commercial success, with worldwide box office taking...
^ Nice movie, but I liked better (with about same kind of plot but more meaningful message) "Enemy of the State"
 
Haven't seen the movie, and no idea where the meme came from. I just thought the picture expressed the idea really well
 
@Borgleader That's not the first time he's done that. :)
Jul 14 at 6:12, by Mysticial
user image
 
3:53 AM
@Borgleader oh do see it. it's worth it (all on account of tommy lee jones as us marshal). vgery good
 
@Mysticial: Haha, thanks for that, that was another great example
@Cheersandhth.-Alf: Yeah, I'll put it on my to-watch list.
 
I have a feeling that this 165888 x 65536 pixel PNG is going to take up more than 1 MB (the limit at which Imgur resizes PNGs)
 
@Cheersandhth.-Alf US Marshals isn't bad either (Tommy Lee does basically the same role again).
 
thanks, not sure i've seen it. unless it was the one about some ira/irish thing?
 
@Mysticial Do you know if Kolink is using the exact same Imgur link?
 
3:56 AM
@Mysticial, So that's how you get that turn-a-bad-question-into-a-good-answer badge.
 
@chris You mean the Reversal badge? :P
 
Yeah, I was too lazy to look, thanks.
 
@Insilico You can check. The post ID is clear in the picture.
It's also in my favorited list if you wanna dig that out.
 
Oh wow, I didn't even see the with Javascript part of the question the first time.
 
@Cheersandhth.-Alf Don't think so. As I recall, in this one, Wesley Snipes plays the guy he's tracking down.
 
3:58 AM
hm
 
@Mysticial It's not an Imgur image. It's a link to a wordpress site.
The two answers use the same link. lol
 
evening everyone :)
 
@Insilico @ITNinja One of you two should either get a real gravatar or change your ip address. I can't tell you two apart without looking at the name.
:)
 
@Mysticial Go ask my ISP to change it on their end. :-)
 
@Mysticial But i like it :3
 
4:02 AM
I'm too much of a lazy-ass to get one.
 
ugh im so tired... but i must get this work done x.x
 
I look at the names all the times, the avatars are too small
 
@Borgleader If the names were drastically different... that wouldn't be the case here would it? :-P
 
@Mysticial Where you here when some of the regulars decided to rename themselves DeadMG or some variant of it?
 
In silico
IT Ninja

Both start with two-letter words beginning with a capital "I". Both have roughly the same length of second word.
 
4:03 AM
Hehe true.dat
 
@Insilico Yes I was. :)
I was the one who pinned shog's message.
 
That happened the first day I started coming here
 
Im somewhat regular in here, but I dont talk all that often lol. Im primarily a Python person :P
 
So it only took libpng 1113 seconds to make a 165888 x 65536 pixel PNG (although the only thing on it is a checkerboard pattern)
 
How big is it? (the file)
 
4:05 AM
The resulting PNG is 10,521 KB.
 
Bigger than I expected
 
Photoshop is showing a progress bar saying "Reading PNG Format".
SHIT JUST GOT REAL
 
does anyone remember the show 'Numb3rs'?
 
Holy crap it's talking Photoshop a while to open it
 
@Insilico hasn't photoshop always supported png (since png was introduced)?
 
4:07 AM
@ITNinja I watch it.
 
Speaking of long computation times, I adapted an example from my "CUDA By Example" book to run on CPU and with C++ amp (you switch between the two by defining, or not, gpu). And the last iteration on CPU takes almost 20 min. On GPU all 5 iterations take a total of 4 sec
 
@Cheersandhth.-Alf A 165888 x 65536 pixel PNG?
 
@Insilico same haha, I love it ^.^
 
Don't have much time for TV nowadays. I catch it whenever I can on Hulu
 
@ITNinja: I watch it from time to time
 
4:09 AM
@Borgleader Amazingly enough libpng's memory usage was basically constant the entire time it was making the big-ass PNG.
 
o.O That's ... interesting
 
@Insilico but in the same vein, when i first ran Solitaire on this laptop, it showed a message about "loading resources" for a long while. how can it even be possible to make anything that needs to go in in a Solitaire program, take any time, at all? but i'm no longer amazed
 
AMAZON Y U NO GIVE SEARCH RESULTS FOR PORTABLE SCREENS WITHOUT DVD PLAYER?
sigh
 
it needs the -searchword option
 
oh, to answer my own question: yes, Solitair, once long ago, had a performance problem. it was used as an example of profiling a program. and the good engineers at microsoft determined that it was the rounded card corners that ate up processor time in some sub-system. so, they squared it out. and it worked.
 
4:11 AM
This PNG is really stressing the hell out of Photoshop. lol
 
is it the xkcd image
 
@Cheersandhth.-Alf: Hah, I wouldn't have guessed that.
 
or is it, like, hubble or spitzer?
 
@Cheersandhth.-Alf Right now I'm testing to see if my hacked-together program can generate a 165888 x 65356 PNG
All it has on it is a checkerboard pattern (each square being 2048 pixels in length)
 
Never used libpng, my go to choice image library is FreeImage
 
4:13 AM
what is that, like 24 GB?
 
@Cheersandhth.-Alf 10 MB.
 
10MB
Compression!
 
Hey look Photoshop was able to open it!
 
huh, is it black/white?
 
@Cheersandhth.-Alf Yes.
 
4:14 AM
he he have fun
 
lol the zoom level is set to 0.7% on my 1080p monitors. XD
 
I actually have a class on image compression algorithms (LZ77, LZW, etc)
 
I'm afraid of doing anything in Photoshop with the 165888 x 65536 pixel PNG loaded.
It would literally take minutes to get anything done with images that big.
 
woot found one :D 17 bucks ftw. totally going to build a portable rasp. pi ;D
 
Tolerance 100%, Foreground Color: Red, Bucket Fill dat ****
@ITNinja: Last time I wanted to order one it was sold out everywhere T_T
 
4:16 AM
I need an image viewer that can view 165888 x 65536 pixel PNGs without taxing itself out.
 
@Insilico microsoft zoom?
 
@Borgleader its about 5 weeks shipping time estimate for me :P
 
Oh god....
 
@Cheersandhth.-Alf I'll look into that, thanks.
 
Does anyone have any font software such as FontForge?
I have a font that needs the family name changed to the font name
 
@ITNinja I wanted to buy an electronic component that had a 50 week lead time. -__-
Obviously the design had to be changed.
 
What the heck was it?
(If I may ask)
 
@Borgleader It's some obscure super-specialized IC.
 
Ahh ok
 
I ended up just using a microcontroller in its place.
 
4:19 AM
ahh, here I was thinking it was a small nuclear reactor.
:P
 
@ITNinja Ahha, no. :-P
 
height of rudeness
 
What?
Are you claiming your answer is the height of rudeness?
 
I linked to that earlier, pretty funny actually
imho
 
0
A: close a browser with php

Registered UserNo, not at all with PHP , PHP is executed at the server-side and thus does not know about clients, browsers or windows of those browsers. <script> window.opener ='m'; window.close(); <\script> This worked for closing the browser, but the fact is that it seems that windows explorer...

 
4:21 AM
sigh php...
 
@R.MartinhoFernandes no the link below "close a browser with php"
 
user406009
More like Pathetic Heaps of Poop.
 
alright yall, im heading to bed, cya :)
 
@RegisteredUser The link you posted goes straight to your answer.
Also, there's a PHP room.

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
 
@R.MartinhoFernandes no its not about the my answer its about the answer given by Kolink with the image
and its just about the way to answer since the user just making the fun of OP
not given him answer
 
4:38 AM
Still trying to find a viewer for huge PNGs.
 
@Insilico I'm just so tempted to deliberately misinterpret that as "a huge program for viewing PNGs (of ordinary size)", and recommend something with an AbstractBitmapViewFactory...
 
@JerryCoffin If I wanted a huge program for viewing PNGs of ordinary size I would just use one of the programs that come with the 400 MB "HP printer driver installation software". :-P
 
I don't get it, I have an std::map with 1 element (according to the return value of std::map::size()) but iterating over it prints two elements and then refuses to terminate. I cannot run the thing in Valgrind, as it's way too slow.
 
Photoshop was able to open the 10,000 megapixel PNG but it swaps the hell out of my computer.
 
it seems to be stuck in operator++
 
4:44 AM
Okay enough screwing around with PNGs.
 
Noooooo! Don't give up now!
 
@R.MartinhoFernandes Oh the problem isn't making the PNG. It's just that as of right now I have no practical way to check that it actually worked. :-/
 
can you upload your image anywhere?
 
@Borgleader Imgur definitely isn't going to work for it.
Right now the 165888 x 65536 pixel PNG I got has just a checkerboard pattern that's 10 MB
 
4:51 AM
I wanted to see if Paint.Net would open it
 
I do have the XKCD picture in 32 165888 x 2048 PNG "strips".
One of the strips are 3 MB. -__-
@R.MartinhoFernandes zoom.it doesn't offer any kind of upload capability
 
5:24 AM
Is there a wait function in C++?
 
std::this_thread::sleep_for(x);. Not 100% sure the syntax is exact.
And it's C++11-only.
And GCC doesn't support <thread> yet :/
 
what about #include <ctime>
 
Nothing to sleep AFAIK
 
Nope.
You can use Boost.Thread.
There are of course platform-specific solutions.
 
^
 
5:29 AM
They say it works here, Doesnt work for me thou :/
 
@MohamedAhmedNabil Prior to C++11, sleep functionality was provided by the operating system.
 
@Insilico I included <dos.h> still nothing
 
@Insilico Put it on some generic host? DropBox?
 
@MohamedAhmedNabil, For example, in Windows: #include <windows.h> Sleep(millis);
 
@chris I think it does.
 
5:31 AM
@R.MartinhoFernandes That's what I'll probably do. Or I might just use Sky Drive since I have an MSN account I don't ever use.
 
both windows.h and dos.h are included
 
Also, sleep functionality is a rarely useful tool.
 
@MohamedAhmedNabil You don't need dos.h if you have windows.h as the latter includes the Sleep() function.
 
@Insilico i got window.h included but sleep is still not working
 
@MohamedAhmedNabil There are at least 2,103,847,314,957,012,834,092,435 different reasons why sleeping the thread may not work. You need to be way more specific.
 
5:34 AM
@Insilico Sleep not sleep ?
 
@MohamedAhmedNabil Yes. C++ is case-sensitive.
 
Thanks :)
Can a program with SendInput() work minimized?
 
Definitely
 
Can i set the program to minimize itself?
 
I think ShowWindow can do that.
 
5:38 AM
@chris Yeah, that's the API function to do that.
 
For whatever reason, in a small thing I made last year (emulating the aero peek click to go to desktop), I used ShowWindowAsync. I forget the reason.
 
if I included for example : <string> in the header file, should I include it again in the source file?
 
@MohamedAhmedNabil It's not necessary if you include that header file in the source file.
It doesn't hurt though, as long as the header files involve have include guards (all the standard headers have them).
 
cemc.math.uwaterloo.ca/contests/computing/2012/stage1/… - Problem 2: Look, std::is_sorted is actually good for something!
Poor C++ people who did that not knowing about it.
 
If it exists, it has to be good for something.
 
5:56 AM
@Insilico so the include guards are by default? because a new header file is empty
 
In the C and C++ programming languages, an #include guard, sometimes called a macro guard, is a particular construct used to avoid the problem of double inclusion when dealing with the include directive. The addition of #include guards to a header file is one way to make that file idempotent. Double inclusion The following C code demonstrates a problem that can arise if #include guards are missing: ;File "grandfather.h" struct foo { int member; }; ;File "father.h" #include "grandfather.h" ;File "child.c" #include "grandfather.h" #include "father.h" Here, the file "child.c"...
They are not included by default.
 
@Insilico if i included it in the header and the source file it cause me no error
 
@MohamedAhmedNabil included what in the header and the source file?
 
@Insilico if i include <string> in both the header and source file. It doesnt give me an error although i didnt use the macro guard
 
@MohamedAhmedNabil, The header is what has the guard.
 
5:58 AM
@chris i know, but even without it im not getting an error
 
@MohamedAhmedNabil The include guards are for your own headers. All the standard headers already have include guards in them.
 
@Insilico but why didnt including <string> in both the header and source file didnt cause an error
 
For example, my `<string>` goes: *comments* `#ifndef _GLIBCXX_STRING
#define _GLIBCXX_STRING 1` *crapload of stuff* `#endif`.
 
@MohamedAhmedNabil Okay, back up for a moment.
 

« first day (705 days earlier)      last day (4234 days later) »