{"id":28,"date":"2009-07-18T12:50:33","date_gmt":"2009-07-18T11:50:33","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=28"},"modified":"2009-07-21T22:45:44","modified_gmt":"2009-07-21T21:45:44","slug":"hello-world","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2009\/07\/18\/hello-world\/","title":{"rendered":"Hello World C C++"},"content":{"rendered":"<p><span id=\"zipfile\"><a href=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/helloworldc.zip\"><\/a><\/span>You can obtain a few version of a c\/c++ compiler from <a title=\"GNU GCC\" href=\"http:\/\/gcc.gnu.org\">GNU<\/a><a title=\"http:\/\/gcc.gnu.org\/\" href=\"http:\/\/gcc.gnu.org\/\" target=\"_blank\"><\/a>, but if you are using <a href=\"http:\/\/www.codingfriends.com\/index.php\/operating_systems\/Linux\/\">Linux<\/a> then you should have the compiler already installed.<\/p>\n<p>To display the classic Hello World, save this code below<\/p>\n<pre lang=\"cpp\">\r\n#include <iostream>\r\n\r\nint main(void)\r\n{\r\n  std::cout << \"Hello world!!\";\r\n}\r\n<\/pre>\n<p>as helloworld.c<\/p>\n<p>Then to compile (if using gcc) into the platform that you are using<\/p>\n<pre class=\"consoleoutput\">\r\n#Linux\r\ng++ helloworld.c -o helloworld\r\n#Windows because windows likes .exe\r\ng++ helloworld.c -o helloworld.exe\r\n<\/pre>\n<p>to run the program, you just need to execute the helloworld file that was created from the above command, if you are using Windows, then you will need to change the line to<\/p>\n<p>The output should be<\/p>\n<pre class=\"consoleoutput\">Hello world!!<\/pre>\n<p>Well that is the classic!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can obtain a few version of a c\/c++ compiler from GNU, but if you are using Linux then you should have the compiler already installed. To display the classic Hello World, save this code below #include int main(void) { std::cout<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[10,9,8,398,400],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-c_and_cpp","tag-c","tag-gcc","tag-gnu","tag-linux","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":35,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}