{"id":18896872,"url":"https://github.com/shakibamoshiri/1000_examples_with_cpp","last_synced_at":"2025-09-20T08:58:24.612Z","repository":{"id":128566362,"uuid":"68110547","full_name":"shakibamoshiri/1000_examples_with_cpp","owner":"shakibamoshiri","description":"Some of my practices and examples that I collected through the Internet","archived":false,"fork":false,"pushed_at":"2017-07-13T14:17:44.000Z","size":2360,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T21:44:07.815Z","etag":null,"topics":["cpp","cpp11","cpp14","examples"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakibamoshiri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-13T13:24:58.000Z","updated_at":"2023-07-02T19:12:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"48293b38-14bc-49d0-ada1-c4282e7307e4","html_url":"https://github.com/shakibamoshiri/1000_examples_with_cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shakibamoshiri/1000_examples_with_cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2F1000_examples_with_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2F1000_examples_with_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2F1000_examples_with_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2F1000_examples_with_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakibamoshiri","download_url":"https://codeload.github.com/shakibamoshiri/1000_examples_with_cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2F1000_examples_with_cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276070743,"owners_count":25580129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp11","cpp14","examples"],"created_at":"2024-11-08T08:35:36.543Z","updated_at":"2025-09-20T08:58:24.575Z","avatar_url":"https://github.com/shakibamoshiri.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Where did these examples come from?**\nI just printed out the whole site of: en.cppreference.com.  \n\n**Well, maybe you ask why am I doing this stupid work?**  \n\n**First** I needed to learn English language, **second** I needed to learn 10-finger-type  \nand **third** I liked learning programming. So I do all three of them together. And I  \ntyped these examples to improve my EN language and TYPING and C++ programming.  \n\n**I tested all these examples with this command-line argument:**  \n`g++ -std=c++14 -O2 -Wall -pedantic -pthread`\n\n*On Gnu / Ubuntu 16.01 LTS and code::blocks IDE 16.01 (32 bit)*\n\nIf you are confusing with my examples, I apologize to you.\n  \n**You can see the major reference sites:**  \n    :one: en.cppreference.com\n    :two: cplusplus.com  \n    :three: msdn.microsoft.com  \n\n\ncompiler:\n\n![my compiler](https://github.com/k-five/1000_examples_with_cpp/blob/master/codeblocks.png)\n\noperating system:\n\n![my OS](https://github.com/k-five/1000_examples_with_cpp/blob/master/os.png)\n\n\n\n# how many way do you know for \"hello world\" in C++?\n```C++\n#include \u003ciostream\u003e\n#include \u003csstream\u003e\n#define HW(...) std::cout\u003c\u003c\"1:\\t\"\u003c\u003c#__VA_ARGS__\u003c\u003cstd::endl;\n\nint main(){\n\n\tHW(hello world!);\n\n\tstd::cout\u003c\u003c\"2:\\thello world!\"\u003c\u003cstd::endl;\n\n\tstd::operator\u003c\u003c(std::cout,\"3:\\thello world!\")\u003c\u003c(std::endl);\n\n\tendl(std::cout\u003c\u003c\"4:\\thello world!\");\n\n\tstd::cout.put('5')\n\t         .put(':')\n\t\t\t .put('\\t')\n\t\t\t .put('h')\n\t\t\t .put('e')\n\t\t\t .put('l')\n\t\t\t .put('l')\n\t\t\t .put('o')\n\t\t\t .put(' ')\n\t\t\t .put('w')\n\t\t\t .put('o')\n\t\t\t .put('r')\n\t\t\t .put('l')\n\t\t\t .put('d')\n\t\t\t .put('!')\n\t\t\t .put('\\n');\n\n\tfor(const char* hw(\"6:\\thello world!\\n\");\n\t\t*hw!='\\0';\n\t\tstd::cout\u003c\u003c*hw++);\n\n\t[]{std::cout\u003c\u003c\"7:\\thello world!\\n\";}();\n\n\tstd::istringstream(\"8:\\thello world!\\n\")\u003e\u003estd::cout.rdbuf();\n}\n```\n\n**output**\n\n```c++\n1:\thello world!\n2:\thello world!\n3:\thello world!\n4:\thello world!\n5:\thello world!\n6:\thello world!\n7:\thello world!\n8:\thello world!\n\n```\n\n# How about obfuscation a code?\n```C++\n#include                         \u003ciostream\u003e\n#include                          \u003csstream\u003e\n#define                            HW(...)\\\nstd::cout\u003c\u003c\"1:\\t\"\u003c\u003c#__VA_ARGS__\u003c\u003cstd::endl;\nint main(){HW(hello world!);std::cout\u003c\u003c\"\"\"\"\n\"2:\\thello world!\"\u003c\u003cstd::endl;std::operator\n\u003c\u003c(std::cout,\"3:\\thello world!\")\u003c\u003c(std::endl\n);endl(std::cout\u003c\u003c\"4:\\thello world!\");std::\n                  cout\n                .put('5')\n                .put(':')\n                .put('\\t')\n                .put('h')\n                .put('e')\n                .put('l')\n                .put('l')\n                .put('o')\n                .put(' ')\n                .put('w')\n                .put('o')\n                .put('r')\n                .put('l')\n                .put('d')\n                .put('!')\n                .put('\\n');\nfor(const char* hw(\"6:\\thello world!\\n\");*hw!=\n'\\0';std::cout\u003c\u003c*hw++);[]{std::cout\u003c\u003c\"7:\\the\"\n  \"llo world!\\n\";}();std::istringstream(\"8:\"\n   \"\\thello world!\\n\")\u003e\u003estd::cout.rdbuf();}\n```\n**output**\n\n`the same as above`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2F1000_examples_with_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakibamoshiri%2F1000_examples_with_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2F1000_examples_with_cpp/lists"}