onebox 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +7 -452
  4. data/Gemfile +1 -1
  5. data/README.md +23 -45
  6. data/lib/onebox.rb +21 -13
  7. data/lib/onebox/engine.rb +53 -43
  8. data/lib/onebox/engine/amazon_onebox.rb +34 -7
  9. data/lib/onebox/engine/classic_google_maps_onebox.rb +37 -0
  10. data/lib/onebox/engine/github_blob_onebox.rb +27 -7
  11. data/lib/onebox/engine/github_commit_onebox.rb +8 -15
  12. data/lib/onebox/engine/github_gist_onebox.rb +10 -10
  13. data/lib/onebox/engine/github_pullrequest_onebox.rb +7 -15
  14. data/lib/onebox/engine/google_play_app_onebox.rb +30 -0
  15. data/lib/onebox/engine/html.rb +10 -1
  16. data/lib/onebox/engine/image_onebox.rb +13 -0
  17. data/lib/onebox/engine/stack_exchange_onebox.rb +25 -11
  18. data/lib/onebox/engine/standard_embed.rb +48 -0
  19. data/lib/onebox/engine/twitter_status_onebox.rb +100 -0
  20. data/lib/onebox/engine/whitelisted_generic_onebox.rb +223 -0
  21. data/lib/onebox/engine/wikipedia_onebox.rb +27 -5
  22. data/lib/onebox/engine/youtube_onebox.rb +22 -0
  23. data/lib/onebox/helpers.rb +24 -0
  24. data/lib/onebox/layout.rb +67 -0
  25. data/lib/onebox/layout_support.rb +16 -0
  26. data/lib/onebox/matcher.rb +6 -1
  27. data/lib/onebox/preview.rb +19 -6
  28. data/lib/onebox/version.rb +1 -1
  29. data/lib/onebox/view.rb +7 -12
  30. data/onebox.gemspec +7 -5
  31. data/spec/fixtures/amazon.response +1336 -2971
  32. data/spec/fixtures/githubblob.response +49 -921
  33. data/spec/fixtures/{android.response → googleplayapp.response} +1 -1
  34. data/spec/fixtures/stackexchange.response +1 -1889
  35. data/spec/fixtures/twitterstatus.response +3006 -0
  36. data/spec/fixtures/youtube-json.response +1 -0
  37. data/spec/fixtures/youtube.response +1625 -0
  38. data/spec/lib/onebox/engine/amazon_onebox_spec.rb +5 -20
  39. data/spec/lib/onebox/engine/classic_google_maps_onebox_spec.rb +28 -0
  40. data/spec/lib/onebox/engine/github_blob_onebox_spec.rb +6 -15
  41. data/spec/lib/onebox/engine/github_commit_onebox_spec.rb +14 -22
  42. data/spec/lib/onebox/engine/github_gist_onebox_spec.rb +6 -14
  43. data/spec/lib/onebox/engine/github_pullrequest_onebox_spec.rb +14 -26
  44. data/spec/lib/onebox/engine/google_play_app_onebox_spec.rb +28 -0
  45. data/spec/lib/onebox/engine/html_spec.rb +4 -6
  46. data/spec/lib/onebox/engine/json_spec.rb +4 -6
  47. data/spec/lib/onebox/engine/stack_exchange_onebox_spec.rb +4 -17
  48. data/spec/lib/onebox/engine/twitter_status_onebox_spec.rb +103 -0
  49. data/spec/lib/onebox/engine/whitelisted_generic_onebox_spec.rb +51 -0
  50. data/spec/lib/onebox/engine/wikipedia_onebox_spec.rb +4 -17
  51. data/spec/lib/onebox/engine/youtube_onebox_spec.rb +17 -0
  52. data/spec/lib/onebox/engine_spec.rb +35 -32
  53. data/spec/lib/onebox/layout_spec.rb +77 -0
  54. data/spec/lib/onebox/matcher_spec.rb +0 -15
  55. data/spec/lib/onebox/preview_spec.rb +39 -9
  56. data/spec/lib/onebox_spec.rb +15 -11
  57. data/spec/spec_helper.rb +60 -4
  58. data/spec/support/html_spec_helper.rb +2 -1
  59. data/templates/_layout.mustache +11 -4
  60. data/templates/amazon.mustache +4 -3
  61. data/templates/githubblob.mustache +7 -5
  62. data/templates/githubcommit.mustache +20 -11
  63. data/templates/githubpullrequest.mustache +19 -12
  64. data/templates/googleplayapp.mustache +4 -0
  65. data/templates/stackexchange.mustache +19 -3
  66. data/templates/twitterstatus.mustache +12 -0
  67. data/templates/whitelistedgeneric.mustache +5 -0
  68. data/templates/wikipedia.mustache +4 -3
  69. metadata +57 -166
  70. data/lib/onebox/engine/bliptv_onebox.rb +0 -28
  71. data/lib/onebox/engine/clikthrough_onebox.rb +0 -25
  72. data/lib/onebox/engine/college_humor_onebox.rb +0 -27
  73. data/lib/onebox/engine/dailymotion_onebox.rb +0 -28
  74. data/lib/onebox/engine/dotsub_onebox.rb +0 -27
  75. data/lib/onebox/engine/example_onebox.rb +0 -24
  76. data/lib/onebox/engine/flickr_onebox.rb +0 -26
  77. data/lib/onebox/engine/funny_or_die_onebox.rb +0 -28
  78. data/lib/onebox/engine/hulu_onebox.rb +0 -29
  79. data/lib/onebox/engine/imgur_image_onebox.rb +0 -26
  80. data/lib/onebox/engine/itunes_onebox.rb +0 -28
  81. data/lib/onebox/engine/kinomap_onebox.rb +0 -27
  82. data/lib/onebox/engine/nfb_onebox.rb +0 -28
  83. data/lib/onebox/engine/open_graph.rb +0 -11
  84. data/lib/onebox/engine/qik_onebox.rb +0 -25
  85. data/lib/onebox/engine/revision3_onebox.rb +0 -27
  86. data/lib/onebox/engine/slideshare_onebox.rb +0 -27
  87. data/lib/onebox/engine/sound_cloud_onebox.rb +0 -27
  88. data/lib/onebox/engine/spotify_onebox.rb +0 -27
  89. data/lib/onebox/engine/ted_onebox.rb +0 -28
  90. data/lib/onebox/engine/twitter_onebox.rb +0 -31
  91. data/lib/onebox/engine/viddler_onebox.rb +0 -28
  92. data/lib/onebox/engine/vimeo_onebox.rb +0 -27
  93. data/lib/onebox/engine/yfrog_onebox.rb +0 -28
  94. data/spec/fixtures/bliptv.response +0 -724
  95. data/spec/fixtures/clikthrough.response +0 -1472
  96. data/spec/fixtures/collegehumor.response +0 -1272
  97. data/spec/fixtures/dailymotion.response +0 -575
  98. data/spec/fixtures/dotsub.response +0 -1257
  99. data/spec/fixtures/example.response +0 -50
  100. data/spec/fixtures/flickr.response +0 -1292
  101. data/spec/fixtures/funnyordie.response +0 -2010
  102. data/spec/fixtures/githubgist.response +0 -468
  103. data/spec/fixtures/hulu.response +0 -339
  104. data/spec/fixtures/imguralbum.response +0 -941
  105. data/spec/fixtures/imgurimage.response +0 -872
  106. data/spec/fixtures/itunes.response +0 -402
  107. data/spec/fixtures/kinomap.response +0 -299
  108. data/spec/fixtures/nfb.response +0 -810
  109. data/spec/fixtures/opengraph.response +0 -27
  110. data/spec/fixtures/qik.response +0 -371
  111. data/spec/fixtures/revision3.response +0 -985
  112. data/spec/fixtures/rottentomatoesfresh.response +0 -3275
  113. data/spec/fixtures/rottentomatoesincomplete.response +0 -2313
  114. data/spec/fixtures/rottentomatoesrotten.response +0 -3549
  115. data/spec/fixtures/slideshare.response +0 -1745
  116. data/spec/fixtures/soundcloud.response +0 -1409
  117. data/spec/fixtures/spotify.response +0 -250
  118. data/spec/fixtures/ted.response +0 -1341
  119. data/spec/fixtures/twitter.response +0 -1712
  120. data/spec/fixtures/viddler.response +0 -442
  121. data/spec/fixtures/vimeo.response +0 -571
  122. data/spec/fixtures/yfrog.response +0 -464
  123. data/spec/lib/onebox/engine/bliptv_onebox_spec.rb +0 -37
  124. data/spec/lib/onebox/engine/clikthrough_onebox_spec.rb +0 -29
  125. data/spec/lib/onebox/engine/college_humor_onebox_spec.rb +0 -37
  126. data/spec/lib/onebox/engine/dailymotion_onebox_spec.rb +0 -39
  127. data/spec/lib/onebox/engine/dotsub_onebox_spec.rb +0 -39
  128. data/spec/lib/onebox/engine/example_onebox_spec.rb +0 -21
  129. data/spec/lib/onebox/engine/flickr_onebox_spec.rb +0 -33
  130. data/spec/lib/onebox/engine/funny_or_die_onebox_spec.rb +0 -37
  131. data/spec/lib/onebox/engine/hulu_onebox_spec.rb +0 -37
  132. data/spec/lib/onebox/engine/imgur_image_onebox_spec.rb +0 -29
  133. data/spec/lib/onebox/engine/itunes_onebox_spec.rb +0 -29
  134. data/spec/lib/onebox/engine/kinomap_onebox_spec.rb +0 -37
  135. data/spec/lib/onebox/engine/nfb_onebox_spec.rb +0 -38
  136. data/spec/lib/onebox/engine/open_graph_spec.rb +0 -27
  137. data/spec/lib/onebox/engine/qik_onebox_spec.rb +0 -38
  138. data/spec/lib/onebox/engine/revision3_onebox_spec.rb +0 -39
  139. data/spec/lib/onebox/engine/slideshare_onebox_spec.rb +0 -33
  140. data/spec/lib/onebox/engine/sound_cloud_onebox_spec.rb +0 -39
  141. data/spec/lib/onebox/engine/spotify_onebox_spec.rb +0 -36
  142. data/spec/lib/onebox/engine/ted_onebox_spec.rb +0 -33
  143. data/spec/lib/onebox/engine/twitter_onebox_spec.rb +0 -47
  144. data/spec/lib/onebox/engine/viddler_onebox_spec.rb +0 -39
  145. data/spec/lib/onebox/engine/vimeo_onebox_spec.rb +0 -37
  146. data/spec/lib/onebox/engine/yfrog_onebox_spec.rb +0 -33
  147. data/spec/lib/onebox/view_spec.rb +0 -16
  148. data/templates/bliptv.mustache +0 -5
  149. data/templates/clikthrough.mustache +0 -4
  150. data/templates/collegehumor.mustache +0 -5
  151. data/templates/dailymotion.mustache +0 -5
  152. data/templates/dotsub.mustache +0 -5
  153. data/templates/example.mustache +0 -2
  154. data/templates/flickr.mustache +0 -4
  155. data/templates/funnyordie.mustache +0 -6
  156. data/templates/githubgist.mustache +0 -3
  157. data/templates/hulu.mustache +0 -6
  158. data/templates/imgurimage.mustache +0 -3
  159. data/templates/itunes.mustache +0 -4
  160. data/templates/kinomap.mustache +0 -5
  161. data/templates/nfb.mustache +0 -5
  162. data/templates/qik.mustache +0 -4
  163. data/templates/revision3.mustache +0 -5
  164. data/templates/slideshare.mustache +0 -4
  165. data/templates/soundcloud.mustache +0 -5
  166. data/templates/spotify.mustache +0 -4
  167. data/templates/ted.mustache +0 -5
  168. data/templates/twitter.mustache +0 -7
  169. data/templates/viddler.mustache +0 -5
  170. data/templates/vimeo.mustache +0 -5
  171. data/templates/yfrog.mustache +0 -4
@@ -135,4 +135,4 @@ if (ab){uab(ab);}
135
135
  if (lmt){ihc(lmt);}
136
136
  if (nbp){snbp(nbp);}
137
137
  if (curl){sglc(curl);}
138
- usc(sc);})();</script> </div>
138
+ usc(sc);})();</script> </div>
@@ -1,1889 +1 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
-
5
- <title>Concept behind these 4 lines of tricky C++ code - Stack Overflow</title>
6
- <link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico">
7
- <link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
8
- <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
9
-
10
- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
11
- <script type="text/javascript" src="//cdn.sstatic.net/js/stub.js"></script>
12
- <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/stackoverflow/all.css">
13
-
14
- <link rel="canonical" href="http://stackoverflow.com/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code">
15
- <link rel="alternate" type="application/atom+xml" title="Feed for question 'Concept behind these 4 lines of tricky C++ code'" href="/feeds/question/17992553">
16
- <script type="text/javascript">
17
-
18
- StackExchange.ready(function () {
19
- StackExchange.using("postValidation", function () {
20
- StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');
21
- });
22
-
23
-
24
- StackExchange.question.init({showAnswerHelp:true,totalCommentCount:20,shownCommentCount:5,highlightColor:'#F4A83D',backgroundColor:'#FFF',questionId:17992553});
25
-
26
- styleCode();
27
-
28
- StackExchange.realtime.subscribeToQuestion('1', '17992553');
29
-
30
- });
31
- </script>
32
-
33
-
34
- <script type="text/javascript">
35
- StackExchange.init({"stackAuthUrl":"https://stackauth.com","serverTime":1375420342,"styleCode":true,"enableUserHovercards":true,"site":{"name":"Stack Overflow","description":"Q&A for professional and enthusiast programmers","isNoticesTabEnabled":true,"recaptchaPublicKey":"6LdchgIAAAAAAJwGpIzRQSOFaO0pU6s44Xt8aTwc","enableSocialMediaInSharePopup":true},"user":{"fkey":"fe82782f4b12b375e13c53e4e1adcdaa","isAnonymous":true}});
36
- StackExchange.using.setCacheBreakers({"js/prettify-full.js":"6c261bebf56a","js/moderator.js":"7cf00e91ce39","js/full-anon.js":"6e2f91b26d0a","js/full.js":"d97a24dfdef3","js/wmd.js":"2f79c03846d5","js/third-party/jquery.autocomplete.min.js":"e5f01e97f7c3","js/mobile.js":"e8e23ad37820","js/help.js":"6e6623243cf6","js/tageditor.js":"450c9e8426fc","js/tageditornew.js":"b6c68ad4c7dd","js/inline-tag-editing.js":"8e84e8a137f7","js/revisions.js":"7273bb714bba","js/review.js":"2b3ae123e376","js/tagsuggestions.js":"aa48ef6154df","js/post-validation.js":"bb996020492a","js/explore-qlist.js":"1c5bbd79b562","js/events.js":"98e7c5a72062"});
37
-
38
- </script>
39
- <script type="text/javascript">
40
- StackExchange.using("gps", function() {
41
- StackExchange.gps.init(true);
42
- });
43
- </script>
44
-
45
- <script type="text/javascript">
46
- StackExchange.ready(function () {
47
- $('#nav-tour').click(function () {
48
- StackExchange.using("gps", function() {
49
- StackExchange.gps.track("aboutpage.click", { aboutclick_location: "headermain" }, true);
50
- });
51
- });
52
- });
53
- </script>
54
- </head>
55
- <body class="question-page">
56
- <noscript><div id="noscript-padding"></div></noscript>
57
- <div id="notify-container"></div>
58
- <div id="overlay-header"></div>
59
- <div id="custom-header"></div>
60
-
61
- <div class="container">
62
- <div id="header" class=headeranon>
63
- <div id="portalLink">
64
- <a class="genu" href="http://stackexchange.com" onclick="StackExchange.ready(function(){genuwine.click();});return false;">Stack Exchange</a>
65
- </div>
66
- <div id="topbar">
67
- <div id="hlinks">
68
-
69
- <span id="hlinks-user"></span>
70
- <span id="hlinks-nav"> <a href="/users/login?returnurl=%2fquestions%2f17992553%2fconcept-behind-these-4-lines-of-tricky-c-code">sign up</a>
71
-
72
- <span class="lsep">|</span>
73
- <a href="/users/login?returnurl=%2fquestions%2f17992553%2fconcept-behind-these-4-lines-of-tricky-c-code">log in</a>
74
-
75
- <span class="lsep">|</span>
76
- <a href="http://careers.stackoverflow.com">careers 2.0</a>
77
-
78
- <span class="lsep">|</span>
79
- </span>
80
- <span id="hlinks-custom"></span>
81
- </div>
82
- <div id="hsearch">
83
- <form id="search" action="/search" method="get" autocomplete="off">
84
- <div>
85
- <input autocomplete="off" name="q" class="textbox" placeholder="search" tabindex="1" type="text" maxlength="240" size="28" value="">
86
- </div>
87
- </form>
88
- </div>
89
- </div>
90
- <br class="cbt">
91
- <div id="hlogo">
92
- <a href="/">
93
- Stack Overflow
94
- </a>
95
- </div>
96
- <div id="hmenus">
97
- <div class="nav mainnavs mainnavsanon">
98
- <ul>
99
- <li class="youarehere"><a id="nav-questions" href="/questions">Questions</a></li>
100
- <li><a id="nav-tags" href="/tags">Tags</a></li>
101
- <li><a id="nav-tour" href="/about">Tour</a></li>
102
- <li><a id="nav-users" href="/users">Users</a></li>
103
- </ul>
104
- </div>
105
- <div class="nav askquestion">
106
- <ul>
107
- <li>
108
- <a id="nav-askquestion" href="/questions/ask">Ask Question</a>
109
- </li>
110
- </ul>
111
- </div>
112
- </div>
113
- </div>
114
-
115
-
116
-
117
-
118
- <div id="content">
119
-
120
-
121
- <div itemscope itemtype="http://schema.org/Article">
122
- <link itemprop="image" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
123
- <!--googleoff: all-->
124
- <div id="herobox-mini">
125
- <div id="hero-content">
126
- <span id="controls">
127
- <a href="/about" id="tell-me-more" class="button">Tell me more</a>
128
- <span id="close"><a title="click to dismiss">&times;</a></span>
129
- </span>
130
- <div id="blurb">
131
- Stack Overflow is a question and answer site for professional and enthusiast programmers. It&#39;s 100% free, no registration required.
132
- </div>
133
- </div>
134
- <script>
135
- $('#tell-me-more').click(function () {
136
- var clickSource = $("body").attr("class") + '-mini';
137
- if ($("body").hasClass("questions-page")) {
138
- clickSource = 'questionpagemini';
139
- }
140
- if ($("body").hasClass("home-page")) {
141
- clickSource = 'homepagemini';
142
- }
143
-
144
- StackExchange.using("gps", function () {
145
- StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource } , true);
146
- });
147
- });
148
- $('#herobox-mini #close').click(function () {
149
- StackExchange.using("gps", function () {
150
- StackExchange.gps.track("hero.action", { hero_action_type: "close" }, true);
151
- });
152
- $.cookie("hero", "none", { path: "/" });
153
- var $hero = $("#herobox-mini");
154
- $hero.slideUp('fast', function () { $hero.remove(); });
155
- return false;
156
- });
157
- </script>
158
- </div>
159
- <!--googleon: all-->
160
- <div id="question-header">
161
- <h1 itemprop="name"><a href="/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code" class="question-hyperlink">Concept behind these 4 lines of tricky C++ code</a></h1>
162
- </div>
163
- <div id="mainbar">
164
-
165
-
166
-
167
- <div class="question" data-questionid="17992553" id="question">
168
-
169
- <div class="everyonelovesstackoverflow" id="adzerk1">
170
- </div>
171
-
172
-
173
- <table>
174
- <tr>
175
- <td class="votecell">
176
-
177
-
178
- <div class="vote">
179
- <input type="hidden" name="_id_" value="17992553">
180
- <a class="vote-up-off" title="This question shows research effort; it is useful and clear">up vote</a>
181
- <span class="vote-count-post ">122</span>
182
- <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful">down vote</a>
183
-
184
- <a class="star-off" href="#" title="This is a favorite question (click again to undo)">favorite</a>
185
- <div class="favoritecount"><b>43</b></div>
186
-
187
- </div>
188
-
189
- </td>
190
-
191
- <td class="postcell">
192
- <div>
193
- <div class="post-text" itemprop="description">
194
- <p>Why does this code gives output <code>C++Sucks</code>? Can anyone explain the concept behind it?</p>
195
-
196
- <pre><code>#include &lt;cstdio&gt;
197
- double m[]= {7709179928849219.0, 771};
198
- int main()
199
- {
200
- m[1]--?m[0]*=2,main():printf((char*)m);
201
- }
202
- </code></pre>
203
-
204
- <p>Here is the Ideone link: <a href="http://ideone.com/PM4qan">http://ideone.com/PM4qan</a></p>
205
-
206
- </div>
207
- <div class="post-taglist">
208
- <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged 'c++'" rel="tag">c++</a>
209
- </div>
210
- <table class="fw">
211
- <tr>
212
- <td class="vt">
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
- <div class="post-menu"><a href="/q/17992553" title="short permalink to this question" class="short-link" id="link-post-17992553">share</a><span class="lsep">|</span><a href="/posts/17992553/edit" class="suggest-edit-post" title="">improve this question</a></div>
225
- </td>
226
- <td align="right" class="post-signature">
227
-
228
-
229
- <div class="user-info user-hover">
230
- <div class="user-action-time">
231
- <a href="/posts/17992553/revisions" title="show all edits to this post">edited <span title="2013-08-01 20:58:33Z" class="relativetime">8 hours ago</span></a>
232
-
233
- </div>
234
- <div class="user-gravatar32">
235
- <a href="/users/84292/chris-b"><div class=""><img src="https://www.gravatar.com/avatar/9b3338e8839b9aedb088b897279c982d?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
236
- </div>
237
- <div class="user-details">
238
- <a href="/users/84292/chris-b">Chris B</a><br>
239
- <span class="reputation-score" title="reputation score" dir="ltr">2,648</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="17 silver badges"><span class="badge2"></span><span class="badgecount">17</span></span><span title="51 bronze badges"><span class="badge3"></span><span class="badgecount">51</span></span>
240
- </div>
241
- </div>
242
- </td>
243
- <td class="post-signature owner">
244
-
245
-
246
- <div class="user-info ">
247
- <div class="user-action-time">
248
- asked <span title="2013-08-01 11:16:08Z" class="relativetime">17 hours ago</span>
249
- </div>
250
- <div class="user-gravatar32">
251
- <a href="/users/2547190/detonator123"><div class=""><img src="https://www.gravatar.com/avatar/a19d396231d67d604c92866b90fe723d?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
252
- </div>
253
- <div class="user-details">
254
- <a href="/users/2547190/detonator123">detonator123</a><br>
255
- <span class="reputation-score" title="reputation score" dir="ltr">258</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="3 silver badges"><span class="badge2"></span><span class="badgecount">3</span></span><span title="6 bronze badges"><span class="badge3"></span><span class="badgecount">6</span></span>
256
- </div>
257
- </div>
258
-
259
- </td>
260
- </tr>
261
- </table>
262
- </div>
263
- </td>
264
- </tr>
265
-
266
-
267
- <tr>
268
- <td class="votecell"></td>
269
- <td>
270
- <div id="comments-17992553" class="comments">
271
- <table>
272
- <tbody>
273
-
274
- <tr id="comment-26306622" class="comment" data-commentid="26306622">
275
- <td class="comment-actions"><table><tbody><tr>
276
- <td class="comment-score">
277
- <span title="number of 'useful comment' votes received" class="supernova">33</span>
278
- </td>
279
- <td>
280
- &nbsp;
281
- </td></tr>
282
- </tbody></table></td>
283
- <td class="comment-text"><div><span class="comment-copy">Magic! And a bit of recursion. But mostly magic.</span> &ndash;&nbsp;<a href="/users/1056003/nijansen" title="1644 reputation" class="comment-user">nijansen</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:19:10Z" class="relativetime-clean">17 hours ago</span></span></div></td>
284
- </tr>
285
-
286
- <tr id="comment-26306739" class="comment" data-commentid="26306739">
287
- <td class="comment-actions"><table><tbody><tr>
288
- <td class="comment-score">
289
- <span title="number of 'useful comment' votes received" class="hot">21</span>
290
- </td>
291
- <td>
292
- &nbsp;
293
- </td></tr>
294
- </tbody></table></td>
295
- <td class="comment-text"><div><span class="comment-copy">Don&#39;t forget Undefined Behaviour!</span> &ndash;&nbsp;<a href="/users/1171191/bobtfish" title="4341 reputation" class="comment-user">BoBTFish</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:22:04Z" class="relativetime-clean">17 hours ago</span></span></div></td>
296
- </tr>
297
-
298
- <tr id="comment-26306776" class="comment" data-commentid="26306776">
299
- <td class="comment-actions"><table><tbody><tr>
300
- <td class="comment-score">
301
- <span title="number of 'useful comment' votes received" class="warm">9</span>
302
- </td>
303
- <td>
304
- &nbsp;
305
- </td></tr>
306
- </tbody></table></td>
307
- <td class="comment-text"><div><span class="comment-copy">@BobTFish The coolest tricks in C always rely on UB, that&#39;s why it&#39;s impossible to get a 20 yr old game running on a modern machine.</span> &ndash;&nbsp;<a href="/users/1056003/nijansen" title="1644 reputation" class="comment-user">nijansen</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:23:02Z" class="relativetime-clean">17 hours ago</span></span></div></td>
308
- </tr>
309
-
310
- <tr id="comment-26308360" class="comment" data-commentid="26308360">
311
- <td class="comment-actions"><table><tbody><tr>
312
- <td class="comment-score">
313
- <span title="number of 'useful comment' votes received" class="supernova">52</span>
314
- </td>
315
- <td>
316
- &nbsp;
317
- </td></tr>
318
- </tbody></table></td>
319
- <td class="comment-text"><div><span class="comment-copy">C++ only sucks the way the author of this code uses it.</span> &ndash;&nbsp;<a href="/users/241536/john-dibling" title="43372 reputation" class="comment-user">John Dibling</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 12:06:03Z" class="relativetime-clean">17 hours ago</span></span></div></td>
320
- </tr>
321
-
322
- <tr id="comment-26313883" class="comment" data-commentid="26313883">
323
- <td class="comment-actions"><table><tbody><tr>
324
- <td class="comment-score">
325
- <span title="number of 'useful comment' votes received" class="supernova">42</span>
326
- </td>
327
- <td>
328
- &nbsp;
329
- </td></tr>
330
- </tbody></table></td>
331
- <td class="comment-text"><div><span class="comment-copy">He could just do <code>puts(&quot;C++Sucks&quot;);</code>. Those C people always over-complicate simple things.</span> &ndash;&nbsp;<a href="/users/412080/maxim-yegorushkin" title="20476 reputation" class="comment-user">Maxim Yegorushkin</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 14:17:37Z" class="relativetime-clean">14 hours ago</span></span></div></td>
332
- </tr>
333
-
334
- </tbody>
335
-
336
- </table>
337
- </div>
338
- <a id="comments-link-17992553" class="comments-link" data-comments-count="15" title="expand to show all comments on this post">show <b>15</b> more comments</a><span id="hidden-comments-link-17992553" class="comments-link dno" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
339
- </td>
340
- </tr> </table>
341
- </div>
342
-
343
-
344
- <div id="answers">
345
-
346
- <a name="tab-top"></a>
347
- <div id="answers-header">
348
- <div class="subheader answers-subheader">
349
- <h2>
350
- 8 Answers
351
- </h2>
352
- <div id="tabs">
353
- <a href="/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
354
- <a href="/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
355
- <a class="youarehere" href="/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>
356
-
357
- </div>
358
- </div>
359
- </div>
360
-
361
-
362
-
363
-
364
-
365
- <a name="17992906"></a>
366
- <div id="answer-17992906" class="answer accepted-answer" data-answerid="17992906" >
367
- <table>
368
- <tr>
369
- <td class="votecell">
370
-
371
-
372
- <div class="vote">
373
- <input type="hidden" name="_id_" value="17992906">
374
- <a class="vote-up-off" title="This answer is useful">up vote</a>
375
- <span class="vote-count-post ">182</span>
376
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
377
-
378
-
379
- <span class="vote-accepted-on load-accepted-answer-date" title="loading when this answer was accepted...">accepted</span>
380
- </div>
381
-
382
- </td>
383
-
384
-
385
-
386
- <td class="answercell">
387
- <div class="post-text"><p>The number <code>7709179928849219.0</code> has the following binary representation as a 64-bit <code>double</code>:</p>
388
-
389
- <pre><code>01000011 00111011 01100011 01110101 01010011 00101011 00101011 01000011
390
- +^^^^^^^ ^^^^---- -------- -------- -------- -------- -------- --------
391
- </code></pre>
392
-
393
- <p><code>+</code> shows the position of the sign; <code>^</code> of the exponent, and <code>-</code> of the mantissa (i.e. the value without the exponent).</p>
394
-
395
- <p>Since the representation uses binary exponent and mantissa, doubling the number increments the exponent by one. Your program does it precisely 771 times, so the exponent which started at 1075 (decimal representation of <code>10000110011</code>) becomes 1075 + 771 = 1846 at the end; binary representation of 1846 is <code>11100110110</code>. The resultant pattern looks like this:</p>
396
-
397
- <pre><code>01110011 01101011 01100011 01110101 01010011 00101011 00101011 01000011
398
- -------- -------- -------- -------- -------- -------- -------- --------
399
- 0x73 's' 0x6B 'k' 0x63 'c' 0x75 'u' 0x53 'S' 0x2B '+' 0x2B '+' 0x43 'C'
400
- </code></pre>
401
-
402
- <p>This pattern corresponds to the string that you see printed, only backwards. At the same time, the second element of the array becomes zero, providing null terminator, making the string suitable for passing to <code>printf</code>.</p>
403
- </div>
404
- <table class="fw">
405
- <tr>
406
- <td class="vt">
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
- <div class="post-menu"><a href="/a/17992906" title="short permalink to this answer" class="short-link" id="link-post-17992906">share</a><span class="lsep">|</span><a href="/posts/17992906/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
419
- <td align="right" class="post-signature">
420
-
421
-
422
- <div class="user-info ">
423
- <div class="user-action-time">
424
- <a href="/posts/17992906/revisions" title="show all edits to this post">edited <span title="2013-08-01 13:55:09Z" class="relativetime">15 hours ago</span></a>
425
-
426
- </div>
427
- <div class="user-gravatar32">
428
-
429
- </div>
430
- <div class="user-details">
431
- <br>
432
-
433
- </div>
434
- </div>
435
- </td>
436
-
437
-
438
-
439
- <td align="right" class="post-signature">
440
-
441
-
442
-
443
-
444
- <div class="user-info user-hover">
445
- <div class="user-action-time">
446
- answered <span title="2013-08-01 11:33:33Z" class="relativetime">17 hours ago</span>
447
- </div>
448
- <div class="user-gravatar32">
449
- <a href="/users/335858/dasblinkenlight"><div class=""><img src="https://www.gravatar.com/avatar/4af3541c00d591e9a518b9c0b3b1190a?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
450
- </div>
451
- <div class="user-details">
452
- <a href="/users/335858/dasblinkenlight">dasblinkenlight</a><br>
453
- <span class="reputation-score" title="reputation score 166179" dir="ltr">166k</span><span title="14 gold badges"><span class="badge1"></span><span class="badgecount">14</span></span><span title="120 silver badges"><span class="badge2"></span><span class="badgecount">120</span></span><span title="241 bronze badges"><span class="badge3"></span><span class="badgecount">241</span></span>
454
- </div>
455
- </div>
456
-
457
- </td>
458
- </tr>
459
- </table>
460
- </td>
461
- </tr>
462
-
463
-
464
-
465
- <tr>
466
- <td class="votecell"></td>
467
- <td>
468
- <div id="comments-17992906" class="comments">
469
- <table>
470
- <tbody>
471
-
472
- <tr id="comment-26311714" class="comment" data-commentid="26311714">
473
- <td class="comment-actions"><table><tbody><tr>
474
- <td class="comment-score">
475
- <span title="number of 'useful comment' votes received" class="warm">6</span>
476
- </td>
477
- <td>
478
- &nbsp;
479
- </td></tr>
480
- </tbody></table></td>
481
- <td class="comment-text"><div><span class="comment-copy">Why is the string backwards?</span> &ndash;&nbsp;<a href="/users/1538531/derek" title="666 reputation" class="comment-user">Derek</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 13:26:41Z" class="relativetime-clean">15 hours ago</span></span></div></td>
482
- </tr>
483
-
484
- <tr id="comment-26312117" class="comment" data-commentid="26312117">
485
- <td class="comment-actions"><table><tbody><tr>
486
- <td class="comment-score">
487
- <span title="number of 'useful comment' votes received" class="hot">18</span>
488
- </td>
489
- <td>
490
- &nbsp;
491
- </td></tr>
492
- </tbody></table></td>
493
- <td class="comment-text"><div><span class="comment-copy">@Derek x86 is little-endian</span> &ndash;&nbsp;<a href="/users/1782465/angew" title="16950 reputation" class="comment-user">Angew</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 13:36:34Z" class="relativetime-clean">15 hours ago</span></span></div></td>
494
- </tr>
495
-
496
- <tr id="comment-26312181" class="comment" data-commentid="26312181">
497
- <td class="comment-actions"><table><tbody><tr>
498
- <td class="comment-score">
499
- <span title="number of 'useful comment' votes received" class="warm">7</span>
500
- </td>
501
- <td>
502
- &nbsp;
503
- </td></tr>
504
- </tbody></table></td>
505
- <td class="comment-text"><div><span class="comment-copy">@Derek This is because of the platform-specific <a href="http://en.wikipedia.org/wiki/Endianness#Endianness_and_hardware" rel="nofollow">endianness</a>: the bytes of the abstract IEEE 754 representation are stored in memory at decreasing addresses, so the string prints correctly. On hardware with big endianness one would need to start with a different number.</span> &ndash;&nbsp;<a href="/users/335858/dasblinkenlight" title="166179 reputation" class="comment-user">dasblinkenlight</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 13:38:12Z" class="relativetime-clean">15 hours ago</span></span><span class="edited-yes" title="this comment was edited"></span></div></td>
506
- </tr>
507
-
508
- <tr id="comment-26316304" class="comment" data-commentid="26316304">
509
- <td class="comment-actions"><table><tbody><tr>
510
- <td class="comment-score">
511
- <span title="number of 'useful comment' votes received" class="cool">4</span>
512
- </td>
513
- <td>
514
- &nbsp;
515
- </td></tr>
516
- </tbody></table></td>
517
- <td class="comment-text"><div><span class="comment-copy">@AlvinWong You are correct, the standard does not require IEEE 754 or any other specific format. This program is about as non-portable as it gets, or very close to it :-)</span> &ndash;&nbsp;<a href="/users/335858/dasblinkenlight" title="166179 reputation" class="comment-user">dasblinkenlight</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 15:14:08Z" class="relativetime-clean">13 hours ago</span></span></div></td>
518
- </tr>
519
-
520
- <tr id="comment-26328419" class="comment" data-commentid="26328419">
521
- <td class="comment-actions"><table><tbody><tr>
522
- <td class="comment-score">
523
- <span title="number of 'useful comment' votes received" class="cool">3</span>
524
- </td>
525
- <td>
526
- &nbsp;
527
- </td></tr>
528
- </tbody></table></td>
529
- <td class="comment-text"><div><span class="comment-copy">@GrijeshChauhan I used a <a href="http://www.binaryconvert.com/convert_double.html" rel="nofollow">double-precision IEEE754 calculator</a>: I pasted the <code>7709179928849219</code> value, and got the binary representation back.</span> &ndash;&nbsp;<a href="/users/335858/dasblinkenlight" title="166179 reputation" class="comment-user">dasblinkenlight</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 20:59:23Z" class="relativetime-clean">8 hours ago</span></span></div></td>
530
- </tr>
531
-
532
- </tbody>
533
-
534
- </table>
535
- </div>
536
- <a id="comments-link-17992906" class="comments-link" data-comments-count="6" title="expand to show all comments on this post">show <b>6</b> more comments</a><span id="hidden-comments-link-17992906" class="comments-link dno" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
537
- </td>
538
- </tr>
539
- </table>
540
- </div>
541
- <div class="everyonelovesstackoverflow" id="adzerk3">
542
- </div>
543
-
544
-
545
-
546
-
547
- <a name="17992776"></a>
548
- <div id="answer-17992776" class="answer" data-answerid="17992776" >
549
- <table>
550
- <tr>
551
- <td class="votecell">
552
-
553
-
554
- <div class="vote">
555
- <input type="hidden" name="_id_" value="17992776">
556
- <a class="vote-up-off" title="This answer is useful">up vote</a>
557
- <span class="vote-count-post ">62</span>
558
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
559
-
560
-
561
- </div>
562
-
563
- </td>
564
-
565
-
566
-
567
- <td class="answercell">
568
- <div class="post-text"><p>More readable version:</p>
569
-
570
- <pre><code>double m[2] = {7709179928849219.0, 771};
571
- // m[0] = 7709179928849219.0;
572
- // m[1] = 771;
573
-
574
- int main()
575
- {
576
- if (m[1]-- != 0)
577
- {
578
- m[0] *= 2;
579
- main();
580
- }
581
- else
582
- {
583
- printf((char*) m);
584
- }
585
- }
586
- </code></pre>
587
-
588
- <p>It recursively calls <code>main()</code> 771 times. In the beginning <code>m[0] = 7709179928849219.0</code>, which <a href="http://ideone.com/CrF1Dh">stands</a> for <code>C++Suc;C</code>. In every call, <code>m[0]</code> gets doubled, to "repair" last two letters. In the last call, <code>m[0]</code> contains ASCII char representation of <code>C++Sucks</code>. It's assuming that <code>m[0]</code> is stored on 8 bytes, so each char takes 1 byte. <code>m[1]</code> contains all zeros, so it has a <a href="http://en.wikipedia.org/wiki/Null-terminated_string">null terminator</a> for <code>C++Sucks</code> string. </p>
589
-
590
- <p>Without recursion and illegal <code>main()</code> calling it will look like this:</p>
591
-
592
- <pre><code>double m[] = {7709179928849219.0, 0};
593
- for (int i = 0; i &lt; 771; i++)
594
- {
595
- m[0] *= 2;
596
- }
597
- printf((char*) m);
598
- </code></pre>
599
- </div>
600
- <table class="fw">
601
- <tr>
602
- <td class="vt">
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
- <div class="post-menu"><a href="/a/17992776" title="short permalink to this answer" class="short-link" id="link-post-17992776">share</a><span class="lsep">|</span><a href="/posts/17992776/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
615
- <td align="right" class="post-signature">
616
-
617
-
618
- <div class="user-info ">
619
- <div class="user-action-time">
620
- <a href="/posts/17992776/revisions" title="show all edits to this post">edited <span title="2013-08-01 13:02:53Z" class="relativetime">16 hours ago</span></a>
621
-
622
- </div>
623
- <div class="user-gravatar32">
624
-
625
- </div>
626
- <div class="user-details">
627
- <br>
628
-
629
- </div>
630
- </div>
631
- </td>
632
-
633
-
634
-
635
- <td align="right" class="post-signature">
636
-
637
-
638
-
639
-
640
- <div class="user-info ">
641
- <div class="user-action-time">
642
- answered <span title="2013-08-01 11:27:16Z" class="relativetime">17 hours ago</span>
643
- </div>
644
- <div class="user-gravatar32">
645
- <a href="/users/1073386/adam-stelmaszczyk"><div class=""><img src="https://www.gravatar.com/avatar/dedaa598e511ee85ead4ed0bc25ea3d3?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
646
- </div>
647
- <div class="user-details">
648
- <a href="/users/1073386/adam-stelmaszczyk">Adam Stelmaszczyk</a><br>
649
- <span class="reputation-score" title="reputation score" dir="ltr">3,076</span><span title="4 silver badges"><span class="badge2"></span><span class="badgecount">4</span></span><span title="24 bronze badges"><span class="badge3"></span><span class="badgecount">24</span></span>
650
- </div>
651
- </div>
652
-
653
- </td>
654
- </tr>
655
- </table>
656
- </td>
657
- </tr>
658
-
659
-
660
-
661
- <tr>
662
- <td class="votecell"></td>
663
- <td>
664
- <div id="comments-17992776" class="comments">
665
- <table>
666
- <tbody>
667
-
668
- <tr id="comment-26307300" class="comment" data-commentid="26307300">
669
- <td class="comment-actions"><table><tbody><tr>
670
- <td class="comment-score">
671
- <span title="number of 'useful comment' votes received" class="cool">1</span>
672
- </td>
673
- <td>
674
- &nbsp;
675
- </td></tr>
676
- </tbody></table></td>
677
- <td class="comment-text"><div><span class="comment-copy">It&#39;s postfix decrement. So it will be called 771 times.</span> &ndash;&nbsp;<a href="/users/1502345/jack-aidley" title="2075 reputation" class="comment-user">Jack Aidley</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:38:12Z" class="relativetime-clean">17 hours ago</span></span></div></td>
678
- </tr>
679
-
680
- <tr id="comment-26307654" class="comment" data-commentid="26307654">
681
- <td class="comment-actions"><table><tbody><tr>
682
- <td class="comment-score">
683
- <span title="number of 'useful comment' votes received" class="cool">1</span>
684
- </td>
685
- <td>
686
- &nbsp;
687
- </td></tr>
688
- </tbody></table></td>
689
- <td class="comment-text"><div><span class="comment-copy">@JackAidley You&#39;re right, thanks. I&#39;ve edited my answer.</span> &ndash;&nbsp;<a href="/users/1073386/adam-stelmaszczyk" title="3076 reputation" class="comment-user">Adam Stelmaszczyk</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:47:19Z" class="relativetime-clean">17 hours ago</span></span></div></td>
690
- </tr>
691
-
692
- <tr id="comment-26313266" class="comment" data-commentid="26313266">
693
- <td class="comment-actions"><table><tbody><tr>
694
- <td class="comment-score">
695
- <span title="number of 'useful comment' votes received" class="cool">1</span>
696
- </td>
697
- <td>
698
- &nbsp;
699
- </td></tr>
700
- </tbody></table></td>
701
- <td class="comment-text"><div><span class="comment-copy">Excellent answer.</span> &ndash;&nbsp;<a href="/users/954986/nathan" title="421 reputation" class="comment-user">Nathan</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 14:03:31Z" class="relativetime-clean">15 hours ago</span></span></div></td>
702
- </tr>
703
-
704
- <tr id="comment-26321414" class="comment" data-commentid="26321414">
705
- <td class="comment-actions"><table><tbody><tr>
706
- <td class="comment-score">
707
- <span title="number of 'useful comment' votes received" class="cool">2</span>
708
- </td>
709
- <td>
710
- &nbsp;
711
- </td></tr>
712
- </tbody></table></td>
713
- <td class="comment-text"><div><span class="comment-copy">this should be the accepted answer, really clears the &#39;obfuscation&#39; of the original code.</span> &ndash;&nbsp;<a href="/users/253805/gandolf" title="92 reputation" class="comment-user">gandolf</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 17:32:43Z" class="relativetime-clean">11 hours ago</span></span></div></td>
714
- </tr>
715
-
716
- </tbody>
717
-
718
- </table>
719
- </div>
720
- <span id="comments-link-17992776" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
721
- </td>
722
- </tr>
723
- </table>
724
- </div>
725
-
726
-
727
- <a name="17992759"></a>
728
- <div id="answer-17992759" class="answer" data-answerid="17992759" >
729
- <table>
730
- <tr>
731
- <td class="votecell">
732
-
733
-
734
- <div class="vote">
735
- <input type="hidden" name="_id_" value="17992759">
736
- <a class="vote-up-off" title="This answer is useful">up vote</a>
737
- <span class="vote-count-post ">58</span>
738
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
739
-
740
-
741
- </div>
742
-
743
- </td>
744
-
745
-
746
-
747
- <td class="answercell">
748
- <div class="post-text"><p>Formally speaking, it's impossible to reason about this program because it's ill-formed (i.e. it's not legal C++). It violates C++11[basic.start.main]p3:</p>
749
-
750
- <blockquote>
751
- <p>The function main shall not be used within a program.</p>
752
- </blockquote>
753
-
754
- <p>This aside, it relies on the fact that on a typical consumer computer, a <code>double</code> is 8 bytes long, and uses a certain well-known internal representation. The initial values of the array are computed so that when the "algorithm" is performed, the final value of the first <code>double</code> will be such that the internal representation (8 bytes) will be the ASCII codes of the 8 characters <code>C++Sucks</code>. The second element in the array is then <code>0.0</code>, whose first byte is <code>0</code> in the internal representation, making this a valid C-style string. This is then sent to output using <code>printf()</code>.</p>
755
-
756
- <p>Running this on HW where some of the above doesn't hold would result in garbage text (or perhaps even an access out of bounds) instead.</p>
757
- </div>
758
- <table class="fw">
759
- <tr>
760
- <td class="vt">
761
-
762
-
763
-
764
-
765
-
766
-
767
-
768
-
769
-
770
-
771
-
772
- <div class="post-menu"><a href="/a/17992759" title="short permalink to this answer" class="short-link" id="link-post-17992759">share</a><span class="lsep">|</span><a href="/posts/17992759/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
773
-
774
-
775
-
776
- <td align="right" class="post-signature">
777
-
778
-
779
-
780
-
781
- <div class="user-info user-hover">
782
- <div class="user-action-time">
783
- answered <span title="2013-08-01 11:26:02Z" class="relativetime">17 hours ago</span>
784
- </div>
785
- <div class="user-gravatar32">
786
- <a href="/users/1782465/angew"><div class=""><img src="https://www.gravatar.com/avatar/b45d92faaf9d122bfed585490e0bafc5?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
787
- </div>
788
- <div class="user-details">
789
- <a href="/users/1782465/angew">Angew</a><br>
790
- <span class="reputation-score" title="reputation score 16950" dir="ltr">17k</span><span title="3 gold badges"><span class="badge1"></span><span class="badgecount">3</span></span><span title="19 silver badges"><span class="badge2"></span><span class="badgecount">19</span></span><span title="43 bronze badges"><span class="badge3"></span><span class="badgecount">43</span></span>
791
- </div>
792
- </div>
793
-
794
- </td>
795
- </tr>
796
- </table>
797
- </td>
798
- </tr>
799
-
800
-
801
-
802
- <tr>
803
- <td class="votecell"></td>
804
- <td>
805
- <div id="comments-17992759" class="comments">
806
- <table>
807
- <tbody>
808
-
809
- <tr id="comment-26307035" class="comment" data-commentid="26307035">
810
- <td class="comment-actions"><table><tbody><tr>
811
- <td class="comment-score">
812
- <span title="number of 'useful comment' votes received" class="warm">13</span>
813
- </td>
814
- <td>
815
- &nbsp;
816
- </td></tr>
817
- </tbody></table></td>
818
- <td class="comment-text"><div><span class="comment-copy">I have to add that this is not an invention of C++11 - C++03 also had <code>basic.start.main</code> 3.6.1/3 with the same wording.</span> &ndash;&nbsp;<a href="/users/57428/sharptooth" title="84637 reputation" class="comment-user">sharptooth</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:30:15Z" class="relativetime-clean">17 hours ago</span></span></div></td>
819
- </tr>
820
-
821
- <tr id="comment-26307053" class="comment" data-commentid="26307053">
822
- <td></td>
823
- <td class="comment-text"><div><span class="comment-copy">The point of this small example is to illustrate what can be done with C++. Magic sample using UB tricks or huge software packages of &quot;classic&quot; code.</span> &ndash;&nbsp;<a href="/users/764191/schepurin" title="945 reputation" class="comment-user">SChepurin</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:30:38Z" class="relativetime-clean">17 hours ago</span></span></div></td>
824
- </tr>
825
-
826
- <tr id="comment-26307114" class="comment" data-commentid="26307114">
827
- <td class="comment-actions"><table><tbody><tr>
828
- <td class="comment-score">
829
- <span title="number of 'useful comment' votes received" class="cool">1</span>
830
- </td>
831
- <td>
832
- &nbsp;
833
- </td></tr>
834
- </tbody></table></td>
835
- <td class="comment-text"><div><span class="comment-copy">+1 for probably better explanation.</span> &ndash;&nbsp;<a href="/users/1400869/d-r" title="1456 reputation" class="comment-user">D.R.</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:33:10Z" class="relativetime-clean">17 hours ago</span></span><span class="edited-yes" title="this comment was edited"></span></div></td>
836
- </tr>
837
-
838
- <tr id="comment-26307302" class="comment" data-commentid="26307302">
839
- <td></td>
840
- <td class="comment-text"><div><span class="comment-copy">@sharptooth Thanks for adding this. I didn&#39;t mean to imply otherwise, I just cited the standard I used.</span> &ndash;&nbsp;<a href="/users/1782465/angew" title="16950 reputation" class="comment-user">Angew</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:38:13Z" class="relativetime-clean">17 hours ago</span></span></div></td>
841
- </tr>
842
-
843
- <tr id="comment-26307405" class="comment" data-commentid="26307405">
844
- <td></td>
845
- <td class="comment-text"><div><span class="comment-copy">@Angew: Yeap, I understand that, just wanted to say that the wording is pretty old.</span> &ndash;&nbsp;<a href="/users/57428/sharptooth" title="84637 reputation" class="comment-user">sharptooth</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 11:41:09Z" class="relativetime-clean">17 hours ago</span></span></div></td>
846
- </tr>
847
-
848
- </tbody>
849
-
850
- </table>
851
- </div>
852
- <span id="comments-link-17992759" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
853
- </td>
854
- </tr>
855
- </table>
856
- </div>
857
-
858
-
859
- <a name="17992693"></a>
860
- <div id="answer-17992693" class="answer" data-answerid="17992693" >
861
- <table>
862
- <tr>
863
- <td class="votecell">
864
-
865
-
866
- <div class="vote">
867
- <input type="hidden" name="_id_" value="17992693">
868
- <a class="vote-up-off" title="This answer is useful">up vote</a>
869
- <span class="vote-count-post ">4</span>
870
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
871
-
872
-
873
- </div>
874
-
875
- </td>
876
-
877
-
878
-
879
- <td class="answercell">
880
- <div class="post-text"><p>It is just building up a double array (16 bytes) which - if interpreted as a char array - build up the ASCII codes for the string "C++Sucks"</p>
881
-
882
- <p>However, the code is not working on each system, it relies on some of the following undefined facts:</p>
883
-
884
- <ul>
885
- <li>double has exactly 8 bytes</li>
886
- <li>double is represented in a certain way</li>
887
- </ul>
888
- </div>
889
- <table class="fw">
890
- <tr>
891
- <td class="vt">
892
-
893
-
894
-
895
-
896
-
897
-
898
-
899
-
900
-
901
-
902
-
903
- <div class="post-menu"><a href="/a/17992693" title="short permalink to this answer" class="short-link" id="link-post-17992693">share</a><span class="lsep">|</span><a href="/posts/17992693/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
904
- <td align="right" class="post-signature">
905
-
906
-
907
- <div class="user-info ">
908
- <div class="user-action-time">
909
- <a href="/posts/17992693/revisions" title="show all edits to this post">edited <span title="2013-08-01 11:29:31Z" class="relativetime">17 hours ago</span></a>
910
-
911
- </div>
912
- <div class="user-gravatar32">
913
-
914
- </div>
915
- <div class="user-details">
916
- <br>
917
-
918
- </div>
919
- </div>
920
- </td>
921
-
922
-
923
-
924
- <td align="right" class="post-signature">
925
-
926
-
927
-
928
-
929
- <div class="user-info ">
930
- <div class="user-action-time">
931
- answered <span title="2013-08-01 11:22:29Z" class="relativetime">17 hours ago</span>
932
- </div>
933
- <div class="user-gravatar32">
934
- <a href="/users/1400869/d-r"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/oX6hC.jpg?s=32&g=1" alt=""></div></a>
935
- </div>
936
- <div class="user-details">
937
- <a href="/users/1400869/d-r">D.R.</a><br>
938
- <span class="reputation-score" title="reputation score" dir="ltr">1,456</span><span title="2 silver badges"><span class="badge2"></span><span class="badgecount">2</span></span><span title="20 bronze badges"><span class="badge3"></span><span class="badgecount">20</span></span>
939
- </div>
940
- </div>
941
-
942
- </td>
943
- </tr>
944
- </table>
945
- </td>
946
- </tr>
947
-
948
-
949
-
950
- <tr>
951
- <td class="votecell"></td>
952
- <td>
953
- <div id="comments-17992693" class="comments dno">
954
- <table>
955
- <tbody>
956
-
957
- <tr><td></td><td></td></tr>
958
-
959
- </tbody>
960
-
961
- </table>
962
- </div>
963
- <span id="comments-link-17992693" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
964
- </td>
965
- </tr>
966
- </table>
967
- </div>
968
-
969
-
970
- <a name="17992996"></a>
971
- <div id="answer-17992996" class="answer" data-answerid="17992996" >
972
- <table>
973
- <tr>
974
- <td class="votecell">
975
-
976
-
977
- <div class="vote">
978
- <input type="hidden" name="_id_" value="17992996">
979
- <a class="vote-up-off" title="This answer is useful">up vote</a>
980
- <span class="vote-count-post ">2</span>
981
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
982
-
983
-
984
- </div>
985
-
986
- </td>
987
-
988
-
989
-
990
- <td class="answercell">
991
- <div class="post-text"><p>The following code prints <code>C++Suc;C</code>, so the whole multiplication is only for the last two letters</p>
992
-
993
- <pre><code>double m[] = {7709179928849219.0, 0};
994
- printf("%s\n", (char *)m);
995
- </code></pre>
996
- </div>
997
- <table class="fw">
998
- <tr>
999
- <td class="vt">
1000
-
1001
-
1002
-
1003
-
1004
-
1005
-
1006
-
1007
-
1008
-
1009
-
1010
-
1011
- <div class="post-menu"><a href="/a/17992996" title="short permalink to this answer" class="short-link" id="link-post-17992996">share</a><span class="lsep">|</span><a href="/posts/17992996/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
1012
- <td align="right" class="post-signature">
1013
-
1014
-
1015
- <div class="user-info user-hover">
1016
- <div class="user-action-time">
1017
- <a href="/posts/17992996/revisions" title="show all edits to this post">edited <span title="2013-08-01 12:05:54Z" class="relativetime">17 hours ago</span></a>
1018
-
1019
- </div>
1020
- <div class="user-gravatar32">
1021
- <a href="/users/366904/cody-gray"><div class=""><img src="https://www.gravatar.com/avatar/3f8912af19fe86b7b34a0b011a962460?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
1022
- </div>
1023
- <div class="user-details">
1024
- <a href="/users/366904/cody-gray">Cody Gray</a><br>
1025
- <span class="reputation-score" title="reputation score 80439" dir="ltr">80.4k</span><span title="10 gold badges"><span class="badge1"></span><span class="badgecount">10</span></span><span title="114 silver badges"><span class="badge2"></span><span class="badgecount">114</span></span><span title="193 bronze badges"><span class="badge3"></span><span class="badgecount">193</span></span>
1026
- </div>
1027
- </div>
1028
- </td>
1029
-
1030
-
1031
-
1032
- <td align="right" class="post-signature">
1033
-
1034
-
1035
-
1036
-
1037
- <div class="user-info ">
1038
- <div class="user-action-time">
1039
- answered <span title="2013-08-01 11:37:53Z" class="relativetime">17 hours ago</span>
1040
- </div>
1041
- <div class="user-gravatar32">
1042
- <a href="/users/1866300/serve-laurijssen"><div class=""><img src="https://www.gravatar.com/avatar/dab16abeddf6aa51bb13e7fe06d70b2c?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
1043
- </div>
1044
- <div class="user-details">
1045
- <a href="/users/1866300/serve-laurijssen">Serv&#233; Laurijssen</a><br>
1046
- <span class="reputation-score" title="reputation score" dir="ltr">267</span><span title="1 silver badge"><span class="badge2"></span><span class="badgecount">1</span></span><span title="9 bronze badges"><span class="badge3"></span><span class="badgecount">9</span></span>
1047
- </div>
1048
- </div>
1049
-
1050
- </td>
1051
- </tr>
1052
- </table>
1053
- </td>
1054
- </tr>
1055
-
1056
-
1057
-
1058
- <tr>
1059
- <td class="votecell"></td>
1060
- <td>
1061
- <div id="comments-17992996" class="comments dno">
1062
- <table>
1063
- <tbody>
1064
-
1065
- <tr><td></td><td></td></tr>
1066
-
1067
- </tbody>
1068
-
1069
- </table>
1070
- </div>
1071
- <span id="comments-link-17992996" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
1072
- </td>
1073
- </tr>
1074
- </table>
1075
- </div>
1076
-
1077
-
1078
- <a name="17996351"></a>
1079
- <div id="answer-17996351" class="answer" data-answerid="17996351" >
1080
- <table>
1081
- <tr>
1082
- <td class="votecell">
1083
-
1084
-
1085
- <div class="vote">
1086
- <input type="hidden" name="_id_" value="17996351">
1087
- <a class="vote-up-off" title="This answer is useful">up vote</a>
1088
- <span class="vote-count-post ">2</span>
1089
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
1090
-
1091
-
1092
- </div>
1093
-
1094
- </td>
1095
-
1096
-
1097
-
1098
- <td class="answercell">
1099
- <div class="post-text"><p>The others have explained the question pretty thoroughly, I'd like to add a note that this is <strong>undefined behavior</strong> according to the standard.</p>
1100
-
1101
- <p>C++11 3.6.1/3 <em>Main function</em></p>
1102
-
1103
- <blockquote>
1104
- <p>The function main shall not be used within a program. The linkage (3.5) of main is implementation-defined. A program that defines main as deleted or that declares main to be inline, static, or constexpr is ill-formed. The name main is not otherwise reserved. [ Example: member functions, classes, and enumerations can be called main, as can entities in other namespaces. —end example ]</p>
1105
- </blockquote>
1106
- </div>
1107
- <table class="fw">
1108
- <tr>
1109
- <td class="vt">
1110
-
1111
-
1112
-
1113
-
1114
-
1115
-
1116
-
1117
-
1118
-
1119
-
1120
-
1121
- <div class="post-menu"><a href="/a/17996351" title="short permalink to this answer" class="short-link" id="link-post-17996351">share</a><span class="lsep">|</span><a href="/posts/17996351/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
1122
-
1123
-
1124
-
1125
- <td align="right" class="post-signature">
1126
-
1127
-
1128
-
1129
-
1130
- <div class="user-info user-hover">
1131
- <div class="user-action-time">
1132
- answered <span title="2013-08-01 14:06:25Z" class="relativetime">15 hours ago</span>
1133
- </div>
1134
- <div class="user-gravatar32">
1135
- <a href="/users/1009479/yu-hao"><div class="gravatar-wrapper-32"><img src="http://i.stack.imgur.com/ju9c8.jpg?s=32&g=1" alt=""></div></a>
1136
- </div>
1137
- <div class="user-details">
1138
- <a href="/users/1009479/yu-hao">Yu Hao</a><br>
1139
- <span class="reputation-score" title="reputation score" dir="ltr">6,987</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="12 silver badges"><span class="badge2"></span><span class="badgecount">12</span></span><span title="45 bronze badges"><span class="badge3"></span><span class="badgecount">45</span></span>
1140
- </div>
1141
- </div>
1142
-
1143
- </td>
1144
- </tr>
1145
- </table>
1146
- </td>
1147
- </tr>
1148
-
1149
-
1150
-
1151
- <tr>
1152
- <td class="votecell"></td>
1153
- <td>
1154
- <div id="comments-17996351" class="comments">
1155
- <table>
1156
- <tbody>
1157
-
1158
- <tr id="comment-26318699" class="comment" data-commentid="26318699">
1159
- <td class="comment-actions"><table><tbody><tr>
1160
- <td class="comment-score">
1161
- <span title="number of 'useful comment' votes received" class="cool">1</span>
1162
- </td>
1163
- <td>
1164
- &nbsp;
1165
- </td></tr>
1166
- </tbody></table></td>
1167
- <td class="comment-text"><div><span class="comment-copy">I&#39;d say it&#39;s even ill-formed (as I did in my answer) - it violates a &quot;shall&quot;.</span> &ndash;&nbsp;<a href="/users/1782465/angew" title="16950 reputation" class="comment-user">Angew</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 16:13:17Z" class="relativetime-clean">12 hours ago</span></span></div></td>
1168
- </tr>
1169
-
1170
- </tbody>
1171
-
1172
- </table>
1173
- </div>
1174
- <span id="comments-link-17996351" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
1175
- </td>
1176
- </tr>
1177
- </table>
1178
- </div>
1179
-
1180
-
1181
- <a name="17992767"></a>
1182
- <div id="answer-17992767" class="answer" data-answerid="17992767" >
1183
- <table>
1184
- <tr>
1185
- <td class="votecell">
1186
-
1187
-
1188
- <div class="vote">
1189
- <input type="hidden" name="_id_" value="17992767">
1190
- <a class="vote-up-off" title="This answer is useful">up vote</a>
1191
- <span class="vote-count-post ">2</span>
1192
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
1193
-
1194
-
1195
- </div>
1196
-
1197
- </td>
1198
-
1199
-
1200
-
1201
- <td class="answercell">
1202
- <div class="post-text"><p>The code could be re-written like this:</p>
1203
-
1204
- <pre><code>void f()
1205
- {
1206
- if (m[1]-- != 0)
1207
- {
1208
- m[0] *= 2;
1209
- f()
1210
- } else {
1211
- printf((char*)m);
1212
- }
1213
- }
1214
- </code></pre>
1215
-
1216
- <p>What it's doing is producing a set of bytes in the <code>double</code> array <code>m</code> that happen to correspond to the characters 'C++Sucks' followed by a null-terminator. They've obfuscated the code by choosing a double value which when doubled 771 times produces, in the standard representation, that set of bytes with the null terminator provided by the second member of the array.</p>
1217
-
1218
- <p>Note that this code wouldn't work under a different endian representation. Also, calling <code>main()</code> is not strictly allowed.</p>
1219
- </div>
1220
- <table class="fw">
1221
- <tr>
1222
- <td class="vt">
1223
-
1224
-
1225
-
1226
-
1227
-
1228
-
1229
-
1230
-
1231
-
1232
-
1233
-
1234
- <div class="post-menu"><a href="/a/17992767" title="short permalink to this answer" class="short-link" id="link-post-17992767">share</a><span class="lsep">|</span><a href="/posts/17992767/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
1235
- <td align="right" class="post-signature">
1236
-
1237
-
1238
- <div class="user-info ">
1239
- <div class="user-action-time">
1240
- <a href="/posts/17992767/revisions" title="show all edits to this post">edited <span title="2013-08-01 15:27:46Z" class="relativetime">13 hours ago</span></a>
1241
-
1242
- </div>
1243
- <div class="user-gravatar32">
1244
-
1245
- </div>
1246
- <div class="user-details">
1247
- <br>
1248
-
1249
- </div>
1250
- </div>
1251
- </td>
1252
-
1253
-
1254
-
1255
- <td align="right" class="post-signature">
1256
-
1257
-
1258
-
1259
-
1260
- <div class="user-info user-hover">
1261
- <div class="user-action-time">
1262
- answered <span title="2013-08-01 11:26:30Z" class="relativetime">17 hours ago</span>
1263
- </div>
1264
- <div class="user-gravatar32">
1265
- <a href="/users/1502345/jack-aidley"><div class=""><img src="https://www.gravatar.com/avatar/2550973bfc1f6c08ff29efee9a1cc7fa?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
1266
- </div>
1267
- <div class="user-details">
1268
- <a href="/users/1502345/jack-aidley">Jack Aidley</a><br>
1269
- <span class="reputation-score" title="reputation score" dir="ltr">2,075</span><span title="3 silver badges"><span class="badge2"></span><span class="badgecount">3</span></span><span title="14 bronze badges"><span class="badge3"></span><span class="badgecount">14</span></span>
1270
- </div>
1271
- </div>
1272
-
1273
- </td>
1274
- </tr>
1275
- </table>
1276
- </td>
1277
- </tr>
1278
-
1279
-
1280
-
1281
- <tr>
1282
- <td class="votecell"></td>
1283
- <td>
1284
- <div id="comments-17992767" class="comments">
1285
- <table>
1286
- <tbody>
1287
-
1288
- <tr id="comment-26310228" class="comment" data-commentid="26310228">
1289
- <td class="comment-actions"><table><tbody><tr>
1290
- <td class="comment-score">
1291
- <span title="number of 'useful comment' votes received" class="cool">2</span>
1292
- </td>
1293
- <td>
1294
- &nbsp;
1295
- </td></tr>
1296
- </tbody></table></td>
1297
- <td class="comment-text"><div><span class="comment-copy">Why does your <code>f</code> return an <code>int</code>?</span> &ndash;&nbsp;<a href="/users/745903/leftaroundabout" title="8027 reputation" class="comment-user">leftaroundabout</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 12:52:33Z" class="relativetime-clean">16 hours ago</span></span></div></td>
1298
- </tr>
1299
-
1300
- <tr id="comment-26316881" class="comment" data-commentid="26316881">
1301
- <td class="comment-actions"><table><tbody><tr>
1302
- <td class="comment-score">
1303
- <span title="number of 'useful comment' votes received" class="cool">1</span>
1304
- </td>
1305
- <td>
1306
- &nbsp;
1307
- </td></tr>
1308
- </tbody></table></td>
1309
- <td class="comment-text"><div><span class="comment-copy">Er, &#39;cos I was brainless copying the <code>int</code> return in the question. Let me fix that.</span> &ndash;&nbsp;<a href="/users/1502345/jack-aidley" title="2075 reputation" class="comment-user">Jack Aidley</a> <span class="comment-date" dir="ltr"><span title="2013-08-01 15:27:36Z" class="relativetime-clean">13 hours ago</span></span></div></td>
1310
- </tr>
1311
-
1312
- </tbody>
1313
-
1314
- </table>
1315
- </div>
1316
- <span id="comments-link-17992767" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
1317
- </td>
1318
- </tr>
1319
- </table>
1320
- </div>
1321
-
1322
-
1323
- <a name="17992807"></a>
1324
- <div id="answer-17992807" class="answer" data-answerid="17992807" >
1325
- <table>
1326
- <tr>
1327
- <td class="votecell">
1328
-
1329
-
1330
- <div class="vote">
1331
- <input type="hidden" name="_id_" value="17992807">
1332
- <a class="vote-up-off" title="This answer is useful">up vote</a>
1333
- <span class="vote-count-post ">0</span>
1334
- <a class="vote-down-off" title="This answer is not useful">down vote</a>
1335
-
1336
-
1337
- </div>
1338
-
1339
- </td>
1340
-
1341
-
1342
-
1343
- <td class="answercell">
1344
- <div class="post-text"><p>Its basically just a clever way to hide the String "C++Sucks" (note the 8 Bytes) within the first double value, which is recursively multiplied with 2 until the seconds double values reaches zero. (771 times)</p>
1345
-
1346
- <p>Multiplying the double values 7709179928849219.0 * 2 * 711 results in "C++Sucks" if you interpret the byte-value of the double as string, which printf() does with the cast. And printf() doesn't fail, because the second double value is "0" and interpreted as "\0" by printf().</p>
1347
- </div>
1348
- <table class="fw">
1349
- <tr>
1350
- <td class="vt">
1351
-
1352
-
1353
-
1354
-
1355
-
1356
-
1357
-
1358
-
1359
-
1360
-
1361
-
1362
- <div class="post-menu"><a href="/a/17992807" title="short permalink to this answer" class="short-link" id="link-post-17992807">share</a><span class="lsep">|</span><a href="/posts/17992807/edit" class="suggest-edit-post" title="">improve this answer</a></div> </td>
1363
-
1364
-
1365
-
1366
- <td align="right" class="post-signature">
1367
-
1368
-
1369
-
1370
-
1371
- <div class="user-info ">
1372
- <div class="user-action-time">
1373
- answered <span title="2013-08-01 11:28:46Z" class="relativetime">17 hours ago</span>
1374
- </div>
1375
- <div class="user-gravatar32">
1376
- <a href="/users/2515209/sir-pancake"><div class=""><img src="https://www.gravatar.com/avatar/150d796555f2e9234fbec615ad669c2b?s=32&d=identicon&r=PG" alt="" width="32" height="32"></div></a>
1377
- </div>
1378
- <div class="user-details">
1379
- <a href="/users/2515209/sir-pancake">Sir Pancake</a><br>
1380
- <span class="reputation-score" title="reputation score" dir="ltr">11</span><span title="1 bronze badge"><span class="badge3"></span><span class="badgecount">1</span></span>
1381
- </div>
1382
- </div>
1383
-
1384
- </td>
1385
- </tr>
1386
- </table>
1387
- </td>
1388
- </tr>
1389
-
1390
-
1391
-
1392
- <tr>
1393
- <td class="votecell"></td>
1394
- <td>
1395
- <div id="comments-17992807" class="comments dno">
1396
- <table>
1397
- <tbody>
1398
-
1399
- <tr><td></td><td></td></tr>
1400
-
1401
- </tbody>
1402
-
1403
- </table>
1404
- </div>
1405
- <span id="comments-link-17992807" class="comments-link" data-comments-counts="0" title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add comment <span>(requires <a href="http://stackoverflow.com/users/login">an account</a> with <a href="http://stackoverflow.com/help/privileges/comment">50 reputation</a>)</span></span>
1406
- </td>
1407
- </tr>
1408
- </table>
1409
- </div>
1410
- <a name='new-answer'></a>
1411
- <form id="post-form" action="/questions/17992553/answer/submit" method="post" class="post-form">
1412
- <input type="hidden" id="post-id" value="17992553" />
1413
- <h2 class="space">Your Answer</h2>
1414
-
1415
-
1416
-
1417
-
1418
- <script type="text/javascript">
1419
- StackExchange.ready(function() {
1420
- initTagRenderer("".split(" "), "".split(" "));
1421
-
1422
- prepareEditor({
1423
- heartbeatType: 'answer',
1424
- bindNavPrevention: true,
1425
- postfix: "",
1426
- onDemand: true,
1427
- discardSelector: ".discard-answer"
1428
- ,immediatelyShowMarkdownHelp:true
1429
- });
1430
-
1431
-
1432
- });
1433
- </script>
1434
-
1435
-
1436
- <div id="post-editor" class="post-editor">
1437
-
1438
- <div style="position: relative;">
1439
- <div class="wmd-container">
1440
- <div id="wmd-button-bar" class="wmd-button-bar"></div>
1441
- <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
1442
- </div>
1443
- </div>
1444
-
1445
- <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
1446
- <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>
1447
-
1448
- <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>
1449
-
1450
-
1451
-
1452
- <div id="wmd-preview" class="wmd-preview"></div>
1453
- <div></div>
1454
- <div class="edit-block">
1455
- <input id="fkey" name="fkey" type="hidden" value="fe82782f4b12b375e13c53e4e1adcdaa">
1456
- <input id="author" name="author" type="text">
1457
- </div>
1458
- </div>
1459
- <div style="position: relative;">
1460
- <div class="form-item dno new-post-login">
1461
-
1462
- <div class="new-login-form">
1463
- <div class="new-login-left">
1464
- <h3>Sign up or <a id="login-link" href="/users/login?returnurl=%2fquestions%2f17992553%2fconcept-behind-these-4-lines-of-tricky-c-code%23new-answer">log in</a></h3>
1465
- <script type="text/javascript">
1466
- StackExchange.ready(function () {
1467
- StackExchange.helpers.onClickDraftSave('#login-link');
1468
- });
1469
- </script>
1470
- <div class="preferred-login google-login">
1471
- <p><span class="icon"></span><span>Sign up using Google</span></p>
1472
- </div>
1473
- <div class="preferred-login facebook-login">
1474
- <p><span class="icon"></span><span>Sign up using Facebook</span></p>
1475
- </div>
1476
- <div class="preferred-login stackexchange-login">
1477
- <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
1478
- </div>
1479
- </div>
1480
- <input type="hidden" name="manual-openid" class="manual-openid" />
1481
- <input type="hidden" name="use-facebook" class="use-facebook" value="false" />
1482
- <input type="button" class="submit-openid" value="Submit" style="display:none" />
1483
- <div class="new-login-right">
1484
- <h3>Post as a guest</h3>
1485
- <div class="form-item">
1486
- <table>
1487
- <tr>
1488
- <script type="text/javascript">
1489
- StackExchange.ready(function () {
1490
- StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
1491
- });
1492
- </script>
1493
- <td class="vm">
1494
- <div>
1495
- <label for="display-name">Name</label>
1496
- <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
1497
- </div>
1498
- <div>
1499
- <label for="m-address">Email</label>
1500
- <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
1501
- <span class="edit-field-overlay">required, but not shown</span>
1502
- </div>
1503
- </td>
1504
- </tr>
1505
- </table>
1506
- </div>
1507
-
1508
- </div>
1509
- </div>
1510
- </div>
1511
- <script type="text/javascript">
1512
- StackExchange.ready(
1513
- function () {
1514
- StackExchange.openid.initPostLogin('.new-post-login', '%2fquestions%2f17992553%2fconcept-behind-these-4-lines-of-tricky-c-code%23new-answer');
1515
- }
1516
- );
1517
- </script>
1518
- <noscript>
1519
- <h3>Post as a guest</h3>
1520
- <div class="form-item">
1521
- <table>
1522
- <tr>
1523
- <script type="text/javascript">
1524
- StackExchange.ready(function () {
1525
- StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
1526
- });
1527
- </script>
1528
- <td class="vm">
1529
- <div>
1530
- <label for="display-name">Name</label>
1531
- <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
1532
- </div>
1533
- <div>
1534
- <label for="m-address">Email</label>
1535
- <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
1536
- <span class="edit-field-overlay">required, but not shown</span>
1537
- </div>
1538
- </td>
1539
- </tr>
1540
- </table>
1541
- </div>
1542
-
1543
- </noscript>
1544
- </div>
1545
-
1546
- <div class="form-submit cbt">
1547
- <input id="submit-button" type="submit" value="Post Your Answer" tabindex="110">
1548
- <a href="#" class="discard-answer dno">discard</a>
1549
- <p class="privacy-policy-agreement">
1550
- By posting your answer, you agree to the
1551
- <a href="http://stackexchange.com/legal/privacy-policy" target="_blank">privacy policy</a> and
1552
- <a href="http://stackexchange.com/legal/terms-of-service" target="_blank">terms of service</a>.
1553
- </p>
1554
- <input type="hidden" name="legalLinksShown" value="1" />
1555
- </div>
1556
- </form>
1557
-
1558
-
1559
-
1560
- <h2 class="bottom-notice">
1561
- Not the answer you're looking for?
1562
- Browse other questions tagged <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged 'c++'" rel="tag">c++</a>
1563
- or <a href="/questions/ask">ask your own question</a>.
1564
- </h2>
1565
- </div>
1566
- </div>
1567
- <div id="sidebar" class="show-votes">
1568
- <div class="module question-stats">
1569
- <p class="label-key">tagged</p>
1570
- <div class="tagged"><a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged 'c++'" rel="tag">c++</a>&nbsp;<span class="item-multiplier"><span class="item-multiplier-x">&times;</span>&nbsp;<span class="item-multiplier-count">216807</span></span><br>
1571
- </div>
1572
- <table id="qinfo">
1573
- <tr>
1574
- <td><p class="label-key">asked</p></td>
1575
- <td style="padding-left:10px"><p class="label-key" title="2013-08-01 11:16:08Z"><b>today</b></p></td>
1576
- </tr>
1577
- <tr>
1578
- <td><p class="label-key">viewed</p></td>
1579
-
1580
- <td style="padding-left:10px">
1581
- <p class="label-key">
1582
- <b>3677 times</b>
1583
- </p>
1584
- </td>
1585
- </tr>
1586
- <tr>
1587
- <td><p class="label-key">active</p></td>
1588
- <td style="padding-left:10px"><p class="label-key"><b><a href="?lastactivity" class="lastactivity-link" title="2013-08-01 20:58:33Z">today</a></b></p></td>
1589
- </tr>
1590
- </table>
1591
- </div>
1592
-
1593
- <script type="text/javascript">
1594
- var scriptSrc = "http://engine.adzerk.net/z/8277/adzerk1_2_4_43,adzerk2_2_17_45,adzerk3_2_4_44?keywords=c%2b%2b";
1595
- if (document.referrer) {
1596
- if (/\?/.test(scriptSrc))
1597
- scriptSrc += "&";
1598
- else
1599
- scriptSrc += "?";
1600
- scriptSrc += "xReferrer=" + document.referrer;
1601
- }
1602
- StackExchange.ready(function() {
1603
- var z = document.createElement("script");
1604
- z.type = "text/javascript";
1605
- z.async = "true";
1606
- z.src = scriptSrc;
1607
- var s = document.getElementsByTagName("script")[0];
1608
- s.parentNode.insertBefore(z, s);
1609
- });
1610
- </script>
1611
- <div class="everyonelovesstackoverflow" id="adzerk2">
1612
- </div>
1613
- <div id="hireme">
1614
- <script type="text/javascript">
1615
- window.careers_adurl="http://careers.stackoverflow.com/gethired/js",window.careers_cssurl="//cdn-careers.sstatic.net/careers/gethired/sidebar.min.css?v=17be6ca0db4b",window.careers_leaderboardcssurl="//cdn-careers.sstatic.net/careers/gethired/ninja.min.css?v=78ccbfa5c59f",window.careers_companycssurl="//cdn-careers.sstatic.net/careers/gethired/company",window.careers_adselector="div.hireme, div#hireme",StackExchange.ready(function(){$.ajax({url:"//cdn-careers.sstatic.net/careers/gethired/loader.min.js?v=607ab2dda910",dataType:"script",cache:!0})}) </script>
1616
- </div>
1617
-
1618
-
1619
-
1620
-
1621
-
1622
- <div class="module sidebar-linked">
1623
- <h4 id="h-linked">Linked</h4>
1624
- <div class="linked" data-tracker="lq=1">
1625
- <div class="spacer">
1626
- <a href="/q/15393441" title="Vote score (upvotes - downvotes)">
1627
- <div class="answer-votes answered-accepted large">600</div>
1628
- </a>
1629
- <a href="/questions/15393441/obfuscated-c-code-contest-2006-please-explain-sykes2-c" class="question-hyperlink">Obfuscated C Code Contest 2006. Please explain sykes2.c</a>
1630
- </div>
1631
-
1632
- </div>
1633
- </div>
1634
- <div class="module sidebar-related">
1635
- <h4 id="h-related">Related</h4>
1636
- <div class="related" data-tracker="rq=1">
1637
- <div class="spacer">
1638
- <a href="/q/388242" title="Vote score (upvotes - downvotes)">
1639
- <div class="answer-votes extra-large">3092</div>
1640
- </a>
1641
- <a href="/questions/388242/the-definitive-c-book-guide-and-list" class="question-hyperlink">The Definitive C++ Book Guide and List</a>
1642
- </div>
1643
- <div class="spacer">
1644
- <a href="/q/3205511" title="Vote score (upvotes - downvotes)">
1645
- <div class="answer-votes default">0</div>
1646
- </a>
1647
- <a href="/questions/3205511/logic-behind-the-code" class="question-hyperlink">logic behind the code</a>
1648
- </div>
1649
- <div class="spacer">
1650
- <a href="/q/9857320" title="Vote score (upvotes - downvotes)">
1651
- <div class="answer-votes answered-accepted default">14</div>
1652
- </a>
1653
- <a href="/questions/9857320/why-does-this-c-code-output-the-result" class="question-hyperlink">Why does this C++ code output the result?</a>
1654
- </div>
1655
- <div class="spacer">
1656
- <a href="/q/10079073" title="Vote score (upvotes - downvotes)">
1657
- <div class="answer-votes answered-accepted default">0</div>
1658
- </a>
1659
- <a href="/questions/10079073/issue-with-c-code-skipping-get-line-statement" class="question-hyperlink">issue with c++ code skipping get line statement</a>
1660
- </div>
1661
- <div class="spacer">
1662
- <a href="/q/11373021" title="Vote score (upvotes - downvotes)">
1663
- <div class="answer-votes answered-accepted default">3</div>
1664
- </a>
1665
- <a href="/questions/11373021/confusion-in-union-concept" class="question-hyperlink">confusion in union concept</a>
1666
- </div>
1667
- <div class="spacer">
1668
- <a href="/q/12813765" title="Vote score (upvotes - downvotes)">
1669
- <div class="answer-votes answered-accepted default">-1</div>
1670
- </a>
1671
- <a href="/questions/12813765/very-simple-c-basic-code" class="question-hyperlink">Very simple C++ basic code</a>
1672
- </div>
1673
- <div class="spacer">
1674
- <a href="/q/14013427" title="Vote score (upvotes - downvotes)">
1675
- <div class="answer-votes answered-accepted default">-2</div>
1676
- </a>
1677
- <a href="/questions/14013427/why-is-my-code-giving-a-run-time-error" class="question-hyperlink">why is my code giving a run time error?</a>
1678
- </div>
1679
- <div class="spacer">
1680
- <a href="/q/16125660" title="Vote score (upvotes - downvotes)">
1681
- <div class="answer-votes answered-accepted large">110</div>
1682
- </a>
1683
- <a href="/questions/16125660/how-did-i-get-a-value-larger-than-8-bits-in-size-from-an-8-bit-integer" class="question-hyperlink">How did I get a value larger than 8 bits in size from an 8-bit integer?</a>
1684
- </div>
1685
- <div class="spacer">
1686
- <a href="/q/17482377" title="Vote score (upvotes - downvotes)">
1687
- <div class="answer-votes answered-accepted default">-5</div>
1688
- </a>
1689
- <a href="/questions/17482377/wrong-concept-in-c-program" class="question-hyperlink">Wrong Concept in C++ Program</a>
1690
- </div>
1691
- <div class="spacer">
1692
- <a href="/q/17773318" title="Vote score (upvotes - downvotes)">
1693
- <div class="answer-votes answered-accepted default">2</div>
1694
- </a>
1695
- <a href="/questions/17773318/shopping-cart-assignment-concepts-on-getline" class="question-hyperlink">Shopping cart assignment, concepts on getline()</a>
1696
- </div>
1697
-
1698
- </div>
1699
- </div>
1700
- </div>
1701
-
1702
- <div id="feed-link">
1703
- <div id="feed-link-text"><a href="/feeds/question/17992553" title="feed of this question and its answers"><span class="feed-icon"></span>question feed</a></div>
1704
- </div>
1705
- <script type="text/javascript">
1706
- StackExchange.ready(function(){$.get('/posts/17992553/ivc/e0eb');});
1707
- </script>
1708
- <noscript>
1709
- <div><img src="/posts/17992553/ivc/e0eb" class="dno" alt="" width="0" height="0"></div>
1710
- </noscript><div style="display:none" id="prettify-lang">lang-c</div></div>
1711
-
1712
-
1713
- </div>
1714
- </div>
1715
- <div id="footer" class="categories">
1716
- <div class="footerwrap">
1717
- <div id="footer-menu">
1718
- <div class="top-footer-links">
1719
- <a href="/about">about</a>
1720
- <a href="/help">help</a>
1721
- <a href="/help/badges">badges</a>
1722
- <a href="http://blog.stackexchange.com?blb=1">blog</a>
1723
- <a href="http://chat.stackoverflow.com">chat</a>
1724
- <a href="http://data.stackexchange.com">data</a>
1725
- <a href="http://stackexchange.com/legal">legal</a>
1726
- <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a>
1727
- <a href="http://stackexchange.com/about/hiring">jobs</a>
1728
- <a href="http://engine.adzerk.net/r?e=eyJhdiI6NDE0LCJhdCI6MjAsImNtIjo5NTQsImNoIjoxMTc4LCJjciI6Mjc3NiwiZG0iOjQsImZjIjoyODYyLCJmbCI6Mjc1MSwibnciOjIyLCJydiI6MCwicHIiOjExNSwic3QiOjAsInVyIjoiaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL2Fib3V0L2NvbnRhY3QiLCJyZSI6MX0&amp;s=hRods5B22XvRBwWIwtIMekcyNF8">advertising info</a>
1729
-
1730
- <a onclick='StackExchange.switchMobile("on", "/questions/17992553/concept-behind-these-4-lines-of-tricky-c-code")'>mobile</a>
1731
- <b><a href="/contact">contact us</a></b>
1732
- <b><a href="http://meta.stackoverflow.com">feedback</a></b>
1733
-
1734
- </div>
1735
- <div id="footer-sites">
1736
- <table>
1737
- <tr>
1738
- <th colspan=3>
1739
- Technology
1740
- </th>
1741
- <th >
1742
- Life / Arts
1743
- </th>
1744
- <th >
1745
- Culture / Recreation
1746
- </th>
1747
- <th >
1748
- Science
1749
- </th>
1750
- <th >
1751
- Other
1752
- </th>
1753
- </tr>
1754
- <tr>
1755
- <td>
1756
- <ol>
1757
- <li><a href="http://stackoverflow.com" title="professional and enthusiast programmers">Stack Overflow</a></li>
1758
- <li><a href="http://serverfault.com" title="professional system and network administrators">Server Fault</a></li>
1759
- <li><a href="http://superuser.com" title="computer enthusiasts and power users">Super User</a></li>
1760
- <li><a href="http://webapps.stackexchange.com" title="power users of web applications">Web Applications</a></li>
1761
- <li><a href="http://askubuntu.com" title="Ubuntu users and developers">Ask Ubuntu</a></li>
1762
- <li><a href="http://webmasters.stackexchange.com" title="pro webmasters">Webmasters</a></li>
1763
- <li><a href="http://gamedev.stackexchange.com" title="professional and independent game developers">Game Development</a></li>
1764
- <li><a href="http://tex.stackexchange.com" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
1765
- </ol></td><td><ol>
1766
- <li><a href="http://programmers.stackexchange.com" title="professional programmers interested in conceptual questions about software development">Programmers</a></li>
1767
- <li><a href="http://unix.stackexchange.com" title="users of Linux, FreeBSD and other Un*x-like operating systems.">Unix &amp; Linux</a></li>
1768
- <li><a href="http://apple.stackexchange.com" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
1769
- <li><a href="http://wordpress.stackexchange.com" title="WordPress developers and administrators">WordPress Answers</a></li>
1770
- <li><a href="http://gis.stackexchange.com" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
1771
- <li><a href="http://electronics.stackexchange.com" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
1772
- <li><a href="http://android.stackexchange.com" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
1773
- <li><a href="http://security.stackexchange.com" title="IT security professionals">IT Security</a></li>
1774
- </ol></td><td><ol>
1775
- <li><a href="http://dba.stackexchange.com" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
1776
- <li><a href="http://drupal.stackexchange.com" title="Drupal developers and administrators">Drupal Answers</a></li>
1777
- <li><a href="http://sharepoint.stackexchange.com" title="SharePoint enthusiasts">SharePoint</a></li>
1778
- <li><a href="http://ux.stackexchange.com" title="user experience researchers and experts">User Experience</a></li>
1779
- <li><a href="http://mathematica.stackexchange.com" title="users of Mathematica">Mathematica</a></li>
1780
-
1781
- <li>
1782
- <a href="http://stackexchange.com/sites#technology" class="more">
1783
- more (13)
1784
- </a>
1785
- </li>
1786
- </ol>
1787
- </td>
1788
- <td>
1789
- <ol>
1790
- <li><a href="http://photo.stackexchange.com" title="professional, enthusiast and amateur photographers">Photography</a></li>
1791
- <li><a href="http://scifi.stackexchange.com" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
1792
- <li><a href="http://cooking.stackexchange.com" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
1793
- <li><a href="http://diy.stackexchange.com" title="contractors and serious DIYers">Home Improvement</a></li>
1794
-
1795
- <li>
1796
- <a href="http://stackexchange.com/sites#lifearts" class="more">
1797
- more (13)
1798
- </a>
1799
- </li>
1800
- </ol>
1801
- </td>
1802
- <td>
1803
- <ol>
1804
- <li><a href="http://english.stackexchange.com" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
1805
- <li><a href="http://skeptics.stackexchange.com" title="scientific skepticism">Skeptics</a></li>
1806
- <li><a href="http://judaism.stackexchange.com" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
1807
- <li><a href="http://travel.stackexchange.com" title="road warriors and seasoned travelers">Travel</a></li>
1808
- <li><a href="http://christianity.stackexchange.com" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
1809
- <li><a href="http://gaming.stackexchange.com" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
1810
- <li><a href="http://bicycles.stackexchange.com" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
1811
- <li><a href="http://rpg.stackexchange.com" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>
1812
-
1813
- <li>
1814
- <a href="http://stackexchange.com/sites#culturerecreation" class="more">
1815
- more (21)
1816
- </a>
1817
- </li>
1818
- </ol>
1819
- </td>
1820
- <td>
1821
- <ol>
1822
- <li><a href="http://math.stackexchange.com" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
1823
- <li><a href="http://stats.stackexchange.com" title="statisticians, data analysts, data miners and data visualization experts">Cross Validated (stats)</a></li>
1824
- <li><a href="http://cstheory.stackexchange.com" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
1825
- <li><a href="http://physics.stackexchange.com" title="active researchers, academics and students of physics">Physics</a></li>
1826
- <li><a href="http://mathoverflow.net" title="professional mathematicians">MathOverflow</a></li>
1827
-
1828
- <li>
1829
- <a href="http://stackexchange.com/sites#science" class="more">
1830
- more (7)
1831
- </a>
1832
- </li>
1833
- </ol>
1834
- </td>
1835
- <td>
1836
- <ol>
1837
- <li><a href="http://stackapps.com" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
1838
- <li><a href="http://meta.stackoverflow.com" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Overflow</a></li>
1839
- <li><a href="http://area51.stackexchange.com" title="proposing new sites in the Stack Exchange network">Area 51</a></li>
1840
- <li><a href="http://careers.stackoverflow.com">Stack Overflow Careers</a></li>
1841
-
1842
- </ol>
1843
- </td>
1844
- </tr>
1845
- </table>
1846
- </div>
1847
- </div>
1848
-
1849
- <div id="copyright">
1850
- site design / logo &copy; 2013 stack exchange inc;
1851
- user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc-wiki</a>
1852
- with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
1853
- </div>
1854
- <div id="footer-flair">
1855
- <a href="http://creativecommons.org/licenses/by-sa/3.0/" class="cc-wiki-link"></a>
1856
- </div>
1857
- <div id="svnrev">
1858
- rev 2013.8.1.914
1859
- </div>
1860
-
1861
- </div>
1862
- </div>
1863
- <noscript>
1864
- <div id="noscript-warning">Stack Overflow works best with JavaScript enabled<img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"></div>
1865
- </noscript>
1866
-
1867
- <script type="text/javascript">var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-5620270-1']);
1868
- _gaq.push(['_setCustomVar', 1, 'tags', '|c++|']);
1869
- _gaq.push(['_trackPageview']);
1870
- var _qevents = _qevents || [];
1871
- (function () {
1872
- var ssl='https:'==document.location.protocol,
1873
- s=document.getElementsByTagName('script')[0],
1874
- ga=document.createElement('script');
1875
- ga.type='text/javascript';
1876
- ga.async=true;
1877
- ga.src=(ssl?'https://ssl':'http://www')+'.google-analytics.com/ga.js';
1878
- s.parentNode.insertBefore(ga,s);
1879
- var sc=document.createElement('script');
1880
- sc.type='text/javascript';
1881
- sc.async=true;
1882
- sc.src=(ssl?'https://secure':'http://edge')+'.quantserve.com/quant.js';
1883
- s.parentNode.insertBefore(sc,s);
1884
- })();
1885
- _qevents.push({ qacct: "p-c1rF4kxgLUzNc" });
1886
- </script>
1887
-
1888
- </body>
1889
- </html>
1
+ {"items":[{"tags":["c++","c","deobfuscation"],"owner":{"reputation":860,"user_id":2547190,"user_type":"registered","profile_image":"https://www.gravatar.com/avatar/a19d396231d67d604c92866b90fe723d?s=128&d=identicon&r=PG","display_name":"detonator123","link":"http://stackoverflow.com/users/2547190/detonator123"},"is_answered":true,"view_count":12676,"protected_date":1375930784,"accepted_answer_id":17992906,"answer_count":9,"score":244,"last_activity_date":1375930729,"creation_date":1375355768,"last_edit_date":1375645180,"question_id":17992553,"link":"http://stackoverflow.com/questions/17992553/concept-behind-these-four-lines-of-tricky-c-code","title":"Concept behind these four lines of tricky C++ code"}],"has_more":false,"quota_max":300,"quota_remaining":275}