{"id":8936,"date":"2018-12-24T10:44:32","date_gmt":"2018-12-24T10:44:32","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=8936"},"modified":"2018-12-24T10:44:32","modified_gmt":"2018-12-24T10:44:32","slug":"programmiersprache-c-c95-c99-c11-c18","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=8936","title":{"rendered":"Programmiersprache C (C95, C99, C11, C18)"},"content":{"rendered":"<p><a href=\"http:\/\/port70.net\/~nsz\/c\/c99\/n1256.html\">C99 Definition<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Null_pointer\">NULL Pointer<\/a><br \/>\n<a href=\"https:\/\/en.wikibooks.org\/wiki\/C_Programming\/stdint.h\">C Programming\/stdint.h<\/a><\/p>\n<p><a href=\"https:\/\/pubs.opengroup.org\/onlinepubs\/009696799\/basedefs\/inttypes.h.html\">inttypes.h &#8211; fixed size integer types<\/a><br \/>\n<a href=\"https:\/\/pubs.opengroup.org\/onlinepubs\/009696799\/basedefs\/stdint.h.html\">stdint.h &#8211; integer types<\/a><\/p>\n<h1>Include<\/h1>\n<table>\n<tr>\n<td>NULL<\/td>\n<td>stddef.h<\/td>\n<\/tr>\n<tr>\n<td>size_t<\/td>\n<td>stddef.h<\/td>\n<\/tr>\n<tr>\n<td>uint32_t<\/td>\n<td>stdint.h<\/td>\n<\/tr>\n<\/table>\n<table>\n<tr>\n<td>stddef.h<\/td>\n<td>NULL, size_t<\/td>\n<\/tr>\n<tr>\n<td>stdbool.h<\/td>\n<td>bool, true, false<\/td>\n<\/tr>\n<tr>\n<td>stdint.h<\/td>\n<td>uint32_t<\/td>\n<\/tr>\n<tr>\n<td>limits.h<\/td>\n<td>INT_MIN, UINT_MAX<\/td>\n<\/tr>\n<tr>\n<td>inttypes.h<\/td>\n<td>PRId32, PRIx32<\/td>\n<\/tr>\n<\/table>\n<p><a href=\"https:\/\/de.wikipedia.org\/wiki\/Varianten_der_Programmiersprache_C#C99\">Varianten der Programmiersprache C<\/a><\/p>\n<h1>Pr\u00e4prozessor<\/h1>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/C_preprocessor\">C preprocessor<\/a><\/p>\n<h3>Stop on Preprocessor<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/4900870\/can-gcc-output-c-code-after-preprocessing\">Can gcc output C code after preprocessing?<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ gcc -E test.c\r\n<\/pre>\n<h3>Concatenation<\/h3>\n<p><a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/cpp\/Concatenation.html\">Concatenation<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nstruct command\r\n{\r\n  char *name;\r\n  void (*function) (void);\r\n};\r\n\r\n#define COMMAND(NAME)  { #NAME, NAME ## _command }\r\n\r\nstruct command commands&#x5B;] =\r\n{\r\n  COMMAND (quit),\r\n  COMMAND (help),\r\n  \u2026\r\n};\r\n\r\n\/* === RESULT === *\/\r\nstruct command commands&#x5B;] =\r\n{\r\n  { &quot;quit&quot;, quit_command },\r\n  { &quot;help&quot;, help_command },\r\n  \u2026\r\n};\r\n<\/pre>\n<h3>Variadic macro <code>__VA_ARGS__<\/code><\/h3>\n<p><a href=\"http:\/\/gcc.gnu.org\/onlinedocs\/cpp\/Variadic-Macros.html\">Variadic Macros<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Variadic_macro\">Variadic macro<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#define MYLOG(FormatLiteral, ...)  \\\r\n        fprintf (stderr, &quot;%s(%u): &quot; FormatLiteral &quot;\\n&quot;, \\\r\n        __FILE__, __LINE__, __VA_ARGS__)\r\n<\/pre>\n<h1>Structs<\/h1>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Struct_(C_programming_language)\">struct (C programming language)<\/a><\/p>\n<h2>Struct initialization<\/h2>\n<h3>Designated Initializer<\/h3>\n<p><a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Designated-Inits.html\">Designated Initializers<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/18731707\/why-does-c11-not-support-designated-initializer-lists-as-c99\">Why does C++11 not support designated initializer lists as C99?<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/* Forward declare a type &quot;point&quot; to be a struct. *\/\r\ntypedef struct point point;\r\n\/* Declare the struct with integer members x, y *\/\r\nstruct point {\r\n   int    x;\r\n   int    y;\r\n};\r\n\r\n\/* Define a variable p of type point, and\r\n   initialize its first two members in place *\/\r\npoint p = {\r\n    1,\r\n    2\r\n};\r\n\r\n\/* Define a variable p of type point, an\r\n   set members using designated  initializers*\/\r\npoint p = { \r\n    .y = 2,\r\n    .x = 1\r\n};\r\n<\/pre>\n<h3><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>C99 Definition NULL Pointer C Programming\/stdint.h inttypes.h &#8211; fixed size integer types stdint.h &#8211; integer types Include NULL stddef.h size_t stddef.h uint32_t stdint.h stddef.h NULL, size_t stdbool.h bool, true, false stdint.h uint32_t limits.h INT_MIN, UINT_MAX inttypes.h PRId32, PRIx32 Varianten der Programmiersprache C Pr\u00e4prozessor C preprocessor Stop on Preprocessor Can gcc output C code after preprocessing? [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8936","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8936"}],"version-history":[{"count":1,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8936\/revisions"}],"predecessor-version":[{"id":8937,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8936\/revisions\/8937"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}