{"id":1587,"date":"2025-06-26T10:37:29","date_gmt":"2025-06-26T09:37:29","guid":{"rendered":"https:\/\/workboot.fr\/ciela\/?page_id=1587"},"modified":"2025-06-26T11:05:25","modified_gmt":"2025-06-26T10:05:25","slug":"printf","status":"publish","type":"page","link":"https:\/\/workboot.fr\/ciela\/printf\/","title":{"rendered":"printf"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">La fonction printf &nbsp; , print format !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">De la biblioth\u00e8que:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#include &lt;stdio.h&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">le fichier header :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/usr\/include\/stdio.h <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html\">http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dans votre terminal  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>man 3 printf<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Le minimum \u00e0 connaitre de cette fonction <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>%i<\/strong>&nbsp;et&nbsp;<strong>%d<\/strong>&nbsp; affiche en d\u00e9cimal<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>%o<\/strong>&nbsp;affiche en octal<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>%x<\/strong>&nbsp;affiche en hexad\u00e9cimal<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">La fonction printf permet aussi ce genre de choses:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">printf(\u00ab\u00a0%02d\u00a0\u00bb, 1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">donnera&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>printf<\/strong>(\u00ab\u00a0%02x\u00a0\u00bb, 15);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>donnera&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>0f<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Exemple d&rsquo;un affichage d&rsquo;une cha\u00eene de caract\u00e8re (string) :<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>printf (\u00a0\u00bb Bonjour le monde \\n\u00a0\u00bb);<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On passe la cha\u00eene \u00e0 afficher ici Bonjour le monde \\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">on peut ici noter que \\n  (lire anti slash n)  va nous provoquer l&rsquo;affichage d&rsquo;un code de contr\u00f4le  (caract\u00e8re 10) qui va faire passer \u00e0 la ligne suivante.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Exemple d&rsquo;un affichage d&rsquo;une cha\u00eene ou int\u00e8gre une valeur en d\u00e9cimale:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>printf (\u00a0\u00bb Bonjour le monde en %d \\n\u00a0\u00bb,2025);<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Format<\/th><th>Signification<\/th><\/tr><\/thead><tbody><tr><td><code>%d<\/code><\/td><td>entier (d\u00e9cimal)<\/td><\/tr><tr><td><code>%f<\/code><\/td><td>r\u00e9el (float\/double)<\/td><\/tr><tr><td><code>%c<\/code><\/td><td>caract\u00e8re<\/td><\/tr><tr><td><code>%s<\/code><\/td><td>cha\u00eene de caract\u00e8res<\/td><\/tr><tr><td><code>%x<\/code><\/td><td>entier (hexad\u00e9cimal)<\/td><\/tr><tr><td><code>%o<\/code><\/td><td>entier (octal)<\/td><\/tr><tr><td><code>%%<\/code><\/td><td>affiche le caract\u00e8re <code>%<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/workboot.fr\/ciela\/td-printf\/\" data-type=\"page\" data-id=\"1594\">TD printf<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>La fonction printf &nbsp; , print format ! De la biblioth\u00e8que: #include &lt;stdio.h&gt; le fichier header : \/usr\/include\/stdio.h http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html Dans votre terminal Le minimum \u00e0 connaitre de cette fonction %i&nbsp;et&nbsp;%d&nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-1587","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>printf - workboot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/workboot.fr\/ciela\/printf\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"printf - workboot\" \/>\n<meta property=\"og:description\" content=\"La fonction printf &nbsp; , print format ! De la biblioth\u00e8que: #include &lt;stdio.h&gt; le fichier header : \/usr\/include\/stdio.h http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html Dans votre terminal Le minimum \u00e0 connaitre de cette fonction %i&nbsp;et&nbsp;%d&nbsp; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/workboot.fr\/ciela\/printf\/\" \/>\n<meta property=\"og:site_name\" content=\"workboot\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-26T10:05:25+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/printf\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/printf\\\/\",\"name\":\"printf - workboot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\"},\"datePublished\":\"2025-06-26T09:37:29+00:00\",\"dateModified\":\"2025-06-26T10:05:25+00:00\",\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/workboot.fr\\\/ciela\\\/printf\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"name\":\"workboot\",\"description\":\"Open Source, Open Minds \",\"publisher\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\",\"name\":\"workboot\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"contentUrl\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"width\":1024,\"height\":950,\"caption\":\"workboot\"},\"image\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"printf - workboot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/workboot.fr\/ciela\/printf\/","og_locale":"fr_FR","og_type":"article","og_title":"printf - workboot","og_description":"La fonction printf &nbsp; , print format ! De la biblioth\u00e8que: #include &lt;stdio.h&gt; le fichier header : \/usr\/include\/stdio.h http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html Dans votre terminal Le minimum \u00e0 connaitre de cette fonction %i&nbsp;et&nbsp;%d&nbsp; [&hellip;]","og_url":"https:\/\/workboot.fr\/ciela\/printf\/","og_site_name":"workboot","article_modified_time":"2025-06-26T10:05:25+00:00","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/workboot.fr\/ciela\/printf\/","url":"https:\/\/workboot.fr\/ciela\/printf\/","name":"printf - workboot","isPartOf":{"@id":"https:\/\/workboot.fr\/ciela\/#website"},"datePublished":"2025-06-26T09:37:29+00:00","dateModified":"2025-06-26T10:05:25+00:00","inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/workboot.fr\/ciela\/printf\/"]}]},{"@type":"WebSite","@id":"https:\/\/workboot.fr\/ciela\/#website","url":"https:\/\/workboot.fr\/ciela\/","name":"workboot","description":"Open Source, Open Minds ","publisher":{"@id":"https:\/\/workboot.fr\/ciela\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/workboot.fr\/ciela\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/workboot.fr\/ciela\/#organization","name":"workboot","url":"https:\/\/workboot.fr\/ciela\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/","url":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","contentUrl":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","width":1024,"height":950,"caption":"workboot"},"image":{"@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/workboot.fr\/ciela\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"La fonction printf &nbsp; , print format ! De la biblioth\u00e8que: #include &lt;stdio.h&gt; le fichier header : \/usr\/include\/stdio.h http:\/\/manpagesfr.free.fr\/man\/man3\/printf.3.html Dans votre terminal Le minimum \u00e0 connaitre de cette fonction %i&nbsp;et&nbsp;%d&nbsp; [&hellip;]","_links":{"self":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/comments?post=1587"}],"version-history":[{"count":5,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1587\/revisions"}],"predecessor-version":[{"id":1602,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1587\/revisions\/1602"}],"wp:attachment":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/media?parent=1587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}