{"id":997,"date":"2015-11-24T11:05:20","date_gmt":"2015-11-24T11:05:20","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=997"},"modified":"2015-11-24T11:05:20","modified_gmt":"2015-11-24T11:05:20","slug":"ascii-to-binary","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/ascii-to-binary\/","title":{"rendered":"ASCII to binary"},"content":{"rendered":"<p>Wird einem char eine <strong>Zahl<\/strong> zugewiesen, so entspricht dies <strong>nicht der bin\u00e4ren Darstellung<\/strong> !<\/p>\n<p><span class=\"lang:sh decode:true  crayon-inline \">int a = 16<\/span>\u00a0 \u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 <span class=\"lang:sh decode:true  crayon-inline \"> 0001 0000<\/span><br \/>\nchar b = &#8218;<strong>16&#8242;<\/strong> \u00a0\u00a0\u00a0 \u00a0 \u00a0 <span class=\"lang:sh decode:true  crayon-inline \">0011 0001<\/span>\u00a0 \u00a0 <span class=\"lang:sh decode:true  crayon-inline \">0011 0110<\/span>\u00a0\u00a0\u00a0\u00a0 sind <strong>zwei<\/strong> Ascii-<strong>Zeichen<\/strong><br \/>\nchar c = &#8218;1&#8216; \u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0\u00a0 <span class=\"lang:sh decode:true  crayon-inline\">0011 0001<\/span><br \/>\nchar d = &#8218;6&#8216; \u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 <span class=\"lang:sh decode:true  crayon-inline \">0011 0110<\/span><br \/>\n<span class=\"lang:sh decode:true  crayon-inline \">int d = 6<\/span>\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0\u00a0 <span class=\"lang:sh decode:true  crayon-inline \">0000 0110<\/span><\/p>\n<p><strong>L\u00f6sung<\/strong><br \/>\nchar c = &#8218;1&#8216; &#8211; &#8218;0&#8216; \u00a0\u00a0 <span class=\"lang:sh decode:true  crayon-inline\">0000 0001<\/span><br \/>\nWill man einen Char, der die Zahl bin\u00e4r darstellt, so muss man den char-Wert &#8218;0&#8216; abziehen. Die Hochkommas sind zwingend, da sonst ein Typcast (zu int) vollzogen wird.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wird einem char eine Zahl zugewiesen, so entspricht dies nicht der bin\u00e4ren Darstellung ! int a = 16\u00a0 \u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 0001 0000 char b = &#8218;16&#8242; \u00a0\u00a0\u00a0 \u00a0 \u00a0 0011 0001\u00a0 \u00a0 0011 0110\u00a0\u00a0\u00a0\u00a0 sind zwei Ascii-Zeichen char c = &#8218;1&#8216; \u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0\u00a0 0011 0001 char d = &#8218;6&#8216; \u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/ascii-to-binary\/\" class=\"more-link\"><span class=\"screen-reader-text\">ASCII to binary<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[29],"tags":[11,74],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/997"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":3,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":1000,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/997\/revisions\/1000"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}