Author |
Topic: Dark corners of C (Read 10618 times) |
|
Barukh
Uberpuzzler
Gender:
Posts: 2276
|
|
Dark corners of C
« on: Mar 25th, 2013, 5:09am » |
Quote Modify
|
It's not a puzzle, but it's cool.
|
|
IP Logged |
|
|
|
peoplepower
Junior Member
Posts: 63
|
|
Re: Dark corners of C
« Reply #1 on: Mar 25th, 2013, 5:37am » |
Quote Modify
|
It turns out that auto was a good placeholder for a useful keyword in C++11.
|
|
IP Logged |
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: Dark corners of C
« Reply #2 on: Mar 25th, 2013, 5:40am » |
Quote Modify
|
I hope it doesn't break the code that is making use of that keyword.
|
|
IP Logged |
|
|
|
peoplepower
Junior Member
Posts: 63
|
|
Re: Dark corners of C
« Reply #3 on: Mar 25th, 2013, 6:03am » |
Quote Modify
|
Indeed, I cannot compile things like auto int i = 0; in the new standard. Hm.. I would be hardpressed to figure out some ambiguous usage of auto.
|
|
IP Logged |
|
|
|
SMQ
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 2084
|
|
Re: Dark corners of C
« Reply #4 on: Mar 25th, 2013, 12:20pm » |
Quote Modify
|
on Mar 25th, 2013, 6:03am, peoplepower wrote:Hm.. I would be hardpressed to figure out some ambiguous usage of auto. |
| double a = 0.0; auto b = a; In C, b will be an int (because a missing type implies int); in C++0x, b will be a double (because the type of an auto variable is implied by the type of the expression assigned to it). Fortunately, in earlier versions of C++ this is a compiler error, because the missing-type-implies-int rule is only in straight C, not C++. So it's only a potential ambiguity if you're attempting to compile straight-C code as C++0x. --SMQ
|
« Last Edit: Mar 25th, 2013, 12:22pm by SMQ » |
IP Logged |
--SMQ
|
|
|
peoplepower
Junior Member
Posts: 63
|
|
Re: Dark corners of C
« Reply #5 on: Mar 25th, 2013, 6:10pm » |
Quote Modify
|
Wow, I did not know that (probably for good reason).
|
|
IP Logged |
|
|
|
JaneBD
Junior Member
Gender:
Posts: 57
|
|
Re: Dark corners of C
« Reply #7 on: Aug 5th, 2014, 3:10pm » |
Quote Modify
|
I've never heard of this ... what exactly is "Dark corners of C" - I get you're referring to the programming language, but is there something new I've not learnt about it?
|
|
IP Logged |
"Do or Do not, there is no try" - Yoda A Work in Progress
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Dark corners of C
« Reply #8 on: Aug 5th, 2014, 11:24pm » |
Quote Modify
|
Just click the link and read the presentation. It's things you can, but probably shouldn't, do in C, because they're weird and/or evil.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
JaneBD
Junior Member
Gender:
Posts: 57
|
|
Re: Dark corners of C
« Reply #9 on: Aug 6th, 2014, 6:11am » |
Quote Modify
|
That's actually pretty cool, thanks for sharing it (:
|
|
IP Logged |
"Do or Do not, there is no try" - Yoda A Work in Progress
|
|
|
|