{"id":76943,"date":"2024-08-15T14:05:45","date_gmt":"2024-08-15T07:05:45","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=76943"},"modified":"2024-08-15T14:05:45","modified_gmt":"2024-08-15T07:05:45","slug":"lap-trinh-c-co-ban","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/","title":{"rendered":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Cu_phap_lap_trinh_C_co_ban_Cach_viet_va_chay_chuong_trinh_%E2%80%9CHello_World%E2%80%9D\" >C\u00fa ph\u00e1p l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u00e1ch vi\u1ebft v\u00e0 ch\u1ea1y ch\u01b0\u01a1ng tr\u00ecnh &#8220;Hello, World!&#8221;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Bien_va_Kieu_du_lieu\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: Bi\u1ebfn v\u00e0 Ki\u1ec3u d\u1eef li\u1ec7u<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Cau_lenh_Dieu_kien\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u00e2u l\u1ec7nh \u0110i\u1ec1u ki\u1ec7n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Vong_lap_trong_C\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: V\u00f2ng l\u1eb7p trong C<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Mang_va_Con_tro\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: M\u1ea3ng v\u00e0 Con tr\u1ecf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Ham_trong_C\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: H\u00e0m trong C<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Struct_va_Union\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: Struct v\u00e0 Union<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Lam_viec_voi_tep_tin\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: L\u00e0m vi\u1ec7c v\u1edbi t\u1ec7p tin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Lap_trinh_C_co_ban_Cap_phat_va_giai_phong_bo_nho_dong_voi_malloc_va_free\" >L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u1ea5p ph\u00e1t v\u00e0 gi\u1ea3i ph\u00f3ng b\u1ed9 nh\u1edb \u0111\u1ed9ng v\u1edbi malloc v\u00e0 free<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Cau_hoi_thuong_gap_ve_lap_trinh_C_co_ban\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#Tong_ket_lap_trinh_C_co_ban\" >T\u1ed5ng k\u1ebft l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>Ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C l\u00e0 m\u1ed9t trong nh\u1eefng ng\u00f4n ng\u1eef \u0111\u00e3 l\u00e0m thay \u0111\u1ed5i ho\u00e0n to\u00e0n th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh t\u1eeb nh\u1eefng n\u0103m 1970. \u0110\u01b0\u1ee3c t\u1ea1o ra b\u1edfi Dennis Ritchie t\u1ea1i AT&amp;T Bell Labs, C kh\u00f4ng ch\u1ec9 l\u00e0 n\u1ec1n t\u1ea3ng c\u1ee7a nhi\u1ec1u ng\u00f4n ng\u1eef hi\u1ec7n \u0111\u1ea1i nh\u01b0 C++, Java, v\u00e0 Python, m\u00e0 c\u00f2n l\u00e0 &#8220;ng\u01b0\u1eddi h\u00f9ng th\u1ea7m l\u1eb7ng&#8221; \u0111\u1eb1ng sau nhi\u1ec1u \u1ee9ng d\u1ee5ng m\u1ea1nh m\u1ebd m\u00e0 ch\u00fang ta s\u1eed d\u1ee5ng h\u00e0ng ng\u00e0y. H\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n s\u1ebd kh\u00f4ng ch\u1ec9 gi\u00fap b\u1ea1n ph\u00e1t tri\u1ec3n c\u00e1c \u1ee9ng d\u1ee5ng m\u1ea1nh m\u1ebd, m\u00e0 c\u00f2n m\u1edf ra c\u00e1nh c\u1eeda \u0111\u1ec3 ti\u1ebfp c\u1eadn v\u00e0 n\u1eafm b\u1eaft nh\u1eefng ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c m\u1ed9t c\u00e1ch d\u1ec5 d\u00e0ng.<\/strong><\/em><\/p>\n<p><span style=\"font-weight: 400;\">B\u00e0i vi\u1ebft n\u00e0y l\u00e0 ph\u1ea7n \u0111\u1ea7u ti\u00ean trong chu\u1ed7i b\u00e0i vi\u1ebft v\u1ec1 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C v\u00e0 C++. Trong ph\u1ea7n n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng \u0111i qua nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n c\u1ee7a ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C, gi\u00fap b\u1ea1n x\u00e2y d\u1ef1ng n\u1ec1n t\u1ea3ng v\u1eefng ch\u1eafc. Tr\u01b0\u1edbc khi ch\u00fang ta b\u01b0\u1edbc v\u00e0o c\u00e1c c\u00e2u l\u1ec7nh n\u00e2ng cao trong C++, \u0111i\u1ec1u quan tr\u1ecdng l\u00e0 ph\u1ea3i hi\u1ec3u r\u00f5 v\u00e0 th\u00e0nh th\u1ea1o c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n trong C. Nh\u1eefng ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng n\u00e0y s\u1ebd gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng h\u01a1n khi chuy\u1ec3n sang h\u1ecdc C++.<\/span><\/p>\n<p>Chu\u1ed7i b\u00e0i vi\u1ebft h\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u00e0 l\u1eadp tr\u00ecnh C++ c\u01a1 b\u1ea3n c\u00f3 n\u1ed9i dung nh\u01b0 sau:<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>Ph\u1ea7n 1: L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft\u00a0<\/strong>(b\u00e0i vi\u1ebft hi\u1ec7n t\u1ea1i)<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ph\u1ea7n 2: <a href=\"https:\/\/itviec.com\/blog\/lap-trinh-cpp-co-ban\/\" target=\"_blank\" rel=\"noopener\">L\u1eadp tr\u00ecnh C++ c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00e2u l\u1ec7nh C++ c\u01a1 b\u1ea3n v\u00e0 n\u00e2ng cao<\/a><\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cu_phap_lap_trinh_C_co_ban_Cach_viet_va_chay_chuong_trinh_%E2%80%9CHello_World%E2%80%9D\"><\/span><b>C\u00fa ph\u00e1p l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u00e1ch vi\u1ebft v\u00e0 ch\u1ea1y ch\u01b0\u01a1ng tr\u00ecnh &#8220;Hello, World!&#8221;<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Ch\u01b0\u01a1ng tr\u00ecnh \u0111\u1ea7u ti\u00ean m\u00e0 m\u1ecdi l\u1eadp tr\u00ecnh vi\u00ean h\u1ecdc l\u00e0 &#8220;Hello, World!&#8221;.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">#include &lt;stdio.h&gt;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> main<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Hello, World!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: In ra chu\u1ed7i &#8220;Hello, World!&#8221; tr\u00ean m\u00e0n h\u00ecnh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: Hello, World!<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Di\u1ec5n gi\u1ea3i:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>#include &lt;stdio.h&gt;<\/strong><span style=\"font-weight: 400;\">: Th\u00eam th\u01b0 vi\u1ec7n chu\u1ea9n v\u00e0o ch\u01b0\u01a1ng tr\u00ecnh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>int main()<\/strong><span style=\"font-weight: 400;\">: H\u00e0m ch\u00ednh, \u0111i\u1ec3m b\u1eaft \u0111\u1ea7u c\u1ee7a ch\u01b0\u01a1ng tr\u00ecnh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>printf(&#8220;Hello, World!\\n&#8221;);<\/strong><span style=\"font-weight: 400;\">: In ra m\u00e0n h\u00ecnh chu\u1ed7i &#8220;Hello, World!&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>return 0;<\/strong><span style=\"font-weight: 400;\">: K\u1ebft th\u00fac ch\u01b0\u01a1ng tr\u00ecnh v\u00e0 tr\u1ea3 v\u1ec1 gi\u00e1 tr\u1ecb 0.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Bien_va_Kieu_du_lieu\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: Bi\u1ebfn v\u00e0 Ki\u1ec3u d\u1eef li\u1ec7u<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Khai b\u00e1o v\u00e0 kh\u1edfi t\u1ea1o bi\u1ebfn<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Bi\u1ebfn l\u00e0 m\u1ed9t t\u00ean g\u1ecdi d\u00f9ng \u0111\u1ec3 l\u01b0u tr\u1eef d\u1eef li\u1ec7u. V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> age = <\/span><span style=\"font-weight: 400;\">25<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">float<\/span><span style=\"font-weight: 400;\"> height = <\/span><span style=\"font-weight: 400;\">1.75<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">char<\/span><span style=\"font-weight: 400;\"> initial = <\/span><span style=\"font-weight: 400;\">'A'<\/span><span style=\"font-weight: 400;\">;<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Khai b\u00e1o v\u00e0 kh\u1edfi t\u1ea1o c\u00e1c bi\u1ebfn age, height, v\u00e0 initial v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb t\u01b0\u01a1ng \u1ee9ng.<\/span><\/li>\n<\/ul>\n<h3><b>C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u c\u01a1 b\u1ea3n trong C<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>int<\/b><span style=\"font-weight: 400;\">: S\u1ed1 nguy\u00ean. V\u00ed d\u1ee5: int a = 5; (a l\u00e0 m\u1ed9t s\u1ed1 nguy\u00ean c\u00f3 gi\u00e1 tr\u1ecb l\u00e0 5)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>float<\/b><span style=\"font-weight: 400;\">: S\u1ed1 th\u1ef1c \u0111\u01a1n. V\u00ed d\u1ee5: float b = 3.14; (b l\u00e0 m\u1ed9t s\u1ed1 th\u1ef1c c\u00f3 gi\u00e1 tr\u1ecb l\u00e0 3.14, \u0111\u1ed9 d\u00e0i 6 ho\u1eb7c 7 ch\u1eef s\u1ed1 th\u1eadp ph\u00e2n)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>double<\/b><span style=\"font-weight: 400;\">: S\u1ed1 th\u1ef1c k\u00e9p. V\u00ed d\u1ee5: double c = 3.141592653589793; (c l\u00e0 m\u1ed9t s\u1ed1 th\u1ef1c k\u00e9p v\u1edbi gi\u00e1 tr\u1ecb 3.141592653589793 \u0111\u1ed9 d\u00e0i g\u1ea5p \u0111\u00f4i s\u1ed1 th\u1ef1c \u0111\u01a1n)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>char<\/b><span style=\"font-weight: 400;\">: K\u00fd t\u1ef1 \u0111\u01a1n. V\u00ed d\u1ee5: char d = &#8216;A&#8217;; (d l\u00e0 m\u1ed9t k\u00fd t\u1ef1 \u0111\u01a1n c\u00f3 gi\u00e1 tr\u1ecb l\u00e0 &#8216;A&#8217;)<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Cau_lenh_Dieu_kien\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u00e2u l\u1ec7nh \u0110i\u1ec1u ki\u1ec7n<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>C\u00e2u L\u1ec7nh if, else if, v\u00e0 else<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u1ea5u tr\u00fac \u0111i\u1ec1u ki\u1ec7n cho ph\u00e9p ch\u01b0\u01a1ng tr\u00ecnh th\u1ef1c hi\u1ec7n c\u00e1c kh\u1ed1i m\u00e3 kh\u00e1c nhau d\u1ef1a tr\u00ean \u0111i\u1ec1u ki\u1ec7n:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> age = <\/span><span style=\"font-weight: 400;\">20<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">if<\/span><span style=\"font-weight: 400;\"> (age &gt;= <\/span><span style=\"font-weight: 400;\">18<\/span><span style=\"font-weight: 400;\">) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"You are an adult.\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">} <\/span><span style=\"font-weight: 400;\">else<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"You are not an adult.\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Ki\u1ec3m tra \u0111i\u1ec1u ki\u1ec7n age &gt;= 18 v\u00e0 in ra th\u00f4ng b\u00e1o t\u01b0\u01a1ng \u1ee9ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu age &gt;= 18: You are an adult.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu age &lt; 18: You are not an adult.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3><b>C\u00e2u L\u1ec7nh switch<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u1ea5u tr\u00fac <\/span><span style=\"font-weight: 400;\">switch<\/span><span style=\"font-weight: 400;\"> cho ph\u00e9p ki\u1ec3m tra gi\u00e1 tr\u1ecb c\u1ee7a m\u1ed9t bi\u1ebfn:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">char<\/span><span style=\"font-weight: 400;\"> grade = <\/span><span style=\"font-weight: 400;\">'B'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">switch<\/span><span style=\"font-weight: 400;\"> (grade) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">case<\/span> <span style=\"font-weight: 400;\">'A'<\/span><span style=\"font-weight: 400;\">:<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Excellent!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">break<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">case<\/span> <span style=\"font-weight: 400;\">'B'<\/span><span style=\"font-weight: 400;\">:<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Good!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">break<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">case<\/span> <span style=\"font-weight: 400;\">'C'<\/span><span style=\"font-weight: 400;\">:<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Average.\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">break<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">default<\/span><span style=\"font-weight: 400;\">:<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Invalid grade.\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">break<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Ki\u1ec3m tra gi\u00e1 tr\u1ecb c\u1ee7a grade v\u00e0 in ra th\u00f4ng b\u00e1o t\u01b0\u01a1ng \u1ee9ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu grade l\u00e0 &#8216;A&#8217;: Excellent!<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu grade l\u00e0 &#8216;B&#8217;: Good!<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu grade l\u00e0 &#8216;C&#8217;: Average.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu grade l\u00e0 gi\u00e1 tr\u1ecb kh\u00e1c: Invalid grade.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Vong_lap_trong_C\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: V\u00f2ng l\u1eb7p trong C<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>V\u00f2ng L\u1eb7p for<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">V\u00f2ng l\u1eb7p <\/span><span style=\"font-weight: 400;\">for<\/span><span style=\"font-weight: 400;\"> th\u01b0\u1eddng \u0111\u01b0\u1ee3c d\u00f9ng khi bi\u1ebft tr\u01b0\u1edbc s\u1ed1 l\u1ea7n l\u1eb7p:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">for<\/span><span style=\"font-weight: 400;\"> (<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> i = <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">; i &lt; <\/span><span style=\"font-weight: 400;\">10<\/span><span style=\"font-weight: 400;\">; i++) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"%d\\n\"<\/span><span style=\"font-weight: 400;\">, i);<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: L\u1eb7p t\u1eeb 0 \u0111\u1ebfn 9 v\u00e0 in ra t\u1eebng gi\u00e1 tr\u1ecb c\u1ee7a i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: In ra c\u00e1c gi\u00e1 tr\u1ecb t\u1eeb 0 \u0111\u1ebfn 9 tr\u00ean m\u1ed7i d\u00f2ng.<\/span><\/li>\n<\/ul>\n<h3><b>V\u00f2ng L\u1eb7p while v\u00e0 do-while<\/b><\/h3>\n<p><b>While:<\/b><span style=\"font-weight: 400;\"> Th\u1ef1c hi\u1ec7n l\u1eb7p khi \u0111i\u1ec1u ki\u1ec7n \u0111\u00fang.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> i = <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">while<\/span><span style=\"font-weight: 400;\"> (i &lt; <\/span><span style=\"font-weight: 400;\">10<\/span><span style=\"font-weight: 400;\">) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"%d\\n\"<\/span><span style=\"font-weight: 400;\">, i);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 i++;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: L\u1eb7p khi \u0111i\u1ec1u ki\u1ec7n i &lt; 10 \u0111\u00fang v\u00e0 in ra gi\u00e1 tr\u1ecb c\u1ee7a i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: In ra c\u00e1c gi\u00e1 tr\u1ecb t\u1eeb 0 \u0111\u1ebfn 9 tr\u00ean m\u1ed7i d\u00f2ng.<\/span><\/li>\n<\/ul>\n<p><b>Do-while:<\/b><span style=\"font-weight: 400;\"> Th\u1ef1c hi\u1ec7n \u00edt nh\u1ea5t m\u1ed9t l\u1ea7n tr\u01b0\u1edbc khi ki\u1ec3m tra \u0111i\u1ec1u ki\u1ec7n.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> i = <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">do<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"%d\\n\"<\/span><span style=\"font-weight: 400;\">, i);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 i++;<\/span>\r\n<span style=\"font-weight: 400;\">} <\/span><span style=\"font-weight: 400;\">while<\/span><span style=\"font-weight: 400;\"> (i &lt; <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">);<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Th\u1ef1c hi\u1ec7n \u00edt nh\u1ea5t m\u1ed9t l\u1ea7n tr\u01b0\u1edbc khi ki\u1ec3m tra \u0111i\u1ec1u ki\u1ec7n i &lt; 0 v\u00e0 in ra gi\u00e1 tr\u1ecb c\u1ee7a i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: In ra gi\u00e1 tr\u1ecb 1.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Mang_va_Con_tro\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: M\u1ea3ng v\u00e0 Con tr\u1ecf<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Khai b\u00e1o v\u00e0 s\u1eed d\u1ee5ng M\u1ea3ng<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ea3ng l\u00e0 t\u1eadp h\u1ee3p c\u00e1c ph\u1ea7n t\u1eed, hay c\u00f2n g\u1ecdi l\u00e0 danh s\u00e1ch c\u00e1c ph\u1ea7n t\u1eed c\u00f9ng ki\u1ec3u d\u1eef li\u1ec7u:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> numbers[<\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\">] = {<\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">4<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\">};<\/span>\r\n<span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"%d\\n\"<\/span><span style=\"font-weight: 400;\">, numbers[<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">]); <\/span><span style=\"font-weight: 400;\">\/\/ In ra ph\u1ea7n t\u1eed \u0111\u1ea7u ti\u00ean<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Khai b\u00e1o m\u1ea3ng numbers v\u00e0 in ra ph\u1ea7n t\u1eed \u0111\u1ea7u ti\u00ean c\u1ee7a m\u1ea3ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: 1<\/span><\/li>\n<\/ul>\n<h3><b>Gi\u1edbi thi\u1ec7u v\u1ec1 con tr\u1ecf v\u00e0 c\u00e1ch s\u1eed d\u1ee5ng<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Con tr\u1ecf l\u00e0 bi\u1ebfn l\u01b0u tr\u1eef \u0111\u1ecba ch\u1ec9 c\u1ee7a bi\u1ebfn kh\u00e1c:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> x = <\/span><span style=\"font-weight: 400;\">10<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> *ptr = &amp;x;<\/span>\r\n<span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"%d\\n\"<\/span><span style=\"font-weight: 400;\">, *ptr); <\/span><span style=\"font-weight: 400;\">\/\/ In ra gi\u00e1 tr\u1ecb c\u1ee7a x th\u00f4ng qua con tr\u1ecf<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: Khai b\u00e1o bi\u1ebfn x, con tr\u1ecf ptr tr\u1ecf \u0111\u1ebfn x, v\u00e0 in ra gi\u00e1 tr\u1ecb c\u1ee7a x th\u00f4ng qua con tr\u1ecf ptr.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: 10<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Ham_trong_C\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: H\u00e0m trong C<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>\u0110\u1ecbnh ngh\u0129a v\u00e0 G\u1ecdi h\u00e0m<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">H\u00e0m l\u00e0 kh\u1ed1i m\u00e3 th\u1ef1c hi\u1ec7n m\u1ed9t nhi\u1ec7m v\u1ee5 c\u1ee5 th\u1ec3:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">void<\/span><span style=\"font-weight: 400;\"> greet<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Hello!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> main<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 greet(); <\/span><span style=\"font-weight: 400;\">\/\/ G\u1ecdi h\u00e0m greet<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: \u0110\u1ecbnh ngh\u0129a h\u00e0m greet v\u00e0 g\u1ecdi h\u00e0m trong main.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: Hello!<\/span><\/li>\n<\/ul>\n<h3><b>Tham s\u1ed1 c\u1ee7a h\u00e0m v\u00e0 ph\u1ea1m vi bi\u1ebfn<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">H\u00e0m c\u00f3 th\u1ec3 nh\u1eadn tham s\u1ed1 v\u00e0 tr\u1ea3 v\u1ec1 gi\u00e1 tr\u1ecb:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> add<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> a, <\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> b)<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span><span style=\"font-weight: 400;\"> a + b;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> main<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> sum = add(<\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Sum: %d\\n\"<\/span><span style=\"font-weight: 400;\">, sum);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: \u0110\u1ecbnh ngh\u0129a h\u00e0m add v\u1edbi hai tham s\u1ed1 v\u00e0 tr\u1ea3 v\u1ec1 t\u1ed5ng c\u1ee7a ch\u00fang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: Sum: 8<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Struct_va_Union\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: Struct v\u00e0 Union<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>\u0110\u1ecbnh ngh\u0129a v\u00e0 s\u1eed d\u1ee5ng struct<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">struct<\/span><span style=\"font-weight: 400;\"> cho ph\u00e9p nh\u00f3m c\u00e1c bi\u1ebfn kh\u00e1c nhau d\u01b0\u1edbi m\u1ed9t t\u00ean chung:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">struct<\/span><span style=\"font-weight: 400;\"> Person {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">char<\/span><span style=\"font-weight: 400;\"> name[<\/span><span style=\"font-weight: 400;\">50<\/span><span style=\"font-weight: 400;\">];<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> age;<\/span>\r\n<span style=\"font-weight: 400;\">};<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> main<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">struct<\/span><span style=\"font-weight: 400;\"> Person person1 = {<\/span><span style=\"font-weight: 400;\">\"John Doe\"<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">30<\/span><span style=\"font-weight: 400;\">};<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Name: %s, Age: %d\\n\"<\/span><span style=\"font-weight: 400;\">, person1.name, person1.age);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: \u0110\u1ecbnh ngh\u0129a struct Person v\u00e0 kh\u1edfi t\u1ea1o bi\u1ebfn person1 v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3, sau \u0111\u00f3 in ra t\u00ean v\u00e0 tu\u1ed5i c\u1ee7a person1.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output: Name: John Doe, Age: 30<\/span><\/li>\n<\/ul>\n<h3><b>Gi\u1edbi thi\u1ec7u v\u1ec1 union<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">union<\/span><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t c\u1ea5u tr\u00fac \u0111\u1eb7c bi\u1ec7t, trong \u0111\u00f3 c\u00e1c bi\u1ebfn d\u00f9ng chung m\u1ed9t v\u00f9ng nh\u1edb:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">union<\/span><span style=\"font-weight: 400;\"> Data {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> i;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">float<\/span><span style=\"font-weight: 400;\"> f;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">char<\/span><span style=\"font-weight: 400;\"> str[<\/span><span style=\"font-weight: 400;\">20<\/span><span style=\"font-weight: 400;\">];<\/span>\r\n<span style=\"font-weight: 400;\">};<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> main<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\"> {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">union<\/span><span style=\"font-weight: 400;\"> Data data;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 data.i = <\/span><span style=\"font-weight: 400;\">10<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"data.i: %d\\n\"<\/span><span style=\"font-weight: 400;\">, data.i);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 data.f = <\/span><span style=\"font-weight: 400;\">220.5<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"data.f: %f\\n\"<\/span><span style=\"font-weight: 400;\">, data.f);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: \u0110\u1ecbnh ngh\u0129a union Data, kh\u1edfi t\u1ea1o bi\u1ebfn data v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3, sau \u0111\u00f3 in ra c\u00e1c gi\u00e1 tr\u1ecb c\u1ee7a data.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Output:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu data.i \u0111\u01b0\u1ee3c in ra: data.i: 10<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u1ebfu data.f \u0111\u01b0\u1ee3c in ra: data.f: 220.500000<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Lam_viec_voi_tep_tin\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: L\u00e0m vi\u1ec7c v\u1edbi t\u1ec7p tin<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>M\u1edf v\u00e0 \u0111\u00f3ng t\u1ec7p<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">FILE *fptr;<\/span>\r\n<span style=\"font-weight: 400;\">fptr = fopen(<\/span><span style=\"font-weight: 400;\">\"file.txt\"<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">\"w\"<\/span><span style=\"font-weight: 400;\">); <\/span><span style=\"font-weight: 400;\">\/\/ M\u1edf t\u1ec7p \u0111\u1ec3 ghi<\/span>\r\n<span style=\"font-weight: 400;\">if<\/span><span style=\"font-weight: 400;\"> (fptr == <\/span><span style=\"font-weight: 400;\">NULL<\/span><span style=\"font-weight: 400;\">) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Error opening file!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n<span style=\"font-weight: 400;\">fclose(fptr); <\/span><span style=\"font-weight: 400;\">\/\/ \u0110\u00f3ng t\u1ec7p<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: M\u1edf t\u1ec7p file.txt \u0111\u1ec3 ghi v\u00e0 \u0111\u00f3ng t\u1ec7p sau khi m\u1edf.<\/span><\/li>\n<\/ul>\n<h3><b>\u0110\u1ecdc v\u00e0 ghi d\u1eef li\u1ec7u v\u00e0o t\u1ec7p<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">fptr = fopen(<\/span><span style=\"font-weight: 400;\">\"file.txt\"<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">\"w\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">fprintf<\/span><span style=\"font-weight: 400;\">(fptr, <\/span><span style=\"font-weight: 400;\">\"Hello, World!\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">fclose(fptr);<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: M\u1edf t\u1ec7p file.txt \u0111\u1ec3 ghi, ghi chu\u1ed7i &#8220;Hello, World!&#8221; v\u00e0o t\u1ec7p, v\u00e0 sau \u0111\u00f3 \u0111\u00f3ng t\u1ec7p.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Lap_trinh_C_co_ban_Cap_phat_va_giai_phong_bo_nho_dong_voi_malloc_va_free\"><\/span><b>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n: C\u1ea5p ph\u00e1t v\u00e0 gi\u1ea3i ph\u00f3ng b\u1ed9 nh\u1edb \u0111\u1ed9ng v\u1edbi malloc v\u00e0 free<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> *ptr = (<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\"> *)<\/span><span style=\"font-weight: 400;\">malloc<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\"> * <\/span><span style=\"font-weight: 400;\">sizeof<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">));<\/span>\r\n<span style=\"font-weight: 400;\">if<\/span><span style=\"font-weight: 400;\"> (ptr == <\/span><span style=\"font-weight: 400;\">NULL<\/span><span style=\"font-weight: 400;\">) {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">\"Memory not allocated.\\n\"<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n<span style=\"font-weight: 400;\">\/\/ S\u1eed d\u1ee5ng b\u1ed9 nh\u1edb<\/span>\r\n<span style=\"font-weight: 400;\">free<\/span><span style=\"font-weight: 400;\">(ptr); <\/span><span style=\"font-weight: 400;\">\/\/ Gi\u1ea3i ph\u00f3ng b\u1ed9 nh\u1edb<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y d\u00f9ng \u0111\u1ec3: C\u1ea5p ph\u00e1t b\u1ed9 nh\u1edb \u0111\u1ed9ng cho m\u1ea3ng ptr v\u00e0 gi\u1ea3i ph\u00f3ng b\u1ed9 nh\u1edb sau khi s\u1eed d\u1ee5ng.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap_ve_lap_trinh_C_co_ban\"><\/span><b>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 b\u1eaft \u0111\u1ea7u h\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">B\u1eaft \u0111\u1ea7u v\u1edbi c\u00e1c t\u00e0i li\u1ec7u c\u01a1 b\u1ea3n v\u00e0 th\u1ef1c h\u00e0nh vi\u1ebft c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh \u0111\u01a1n gi\u1ea3n. T\u00ecm hi\u1ec3u c\u00fa ph\u00e1p v\u00e0 c\u00e1c kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n nh\u01b0 bi\u1ebfn, ki\u1ec3u d\u1eef li\u1ec7u, c\u00e2u l\u1ec7nh \u0111i\u1ec1u ki\u1ec7n, v\u00f2ng l\u1eb7p.<\/span><\/p>\n<h3><b>Nh\u1eefng l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi l\u1eadp tr\u00ecnh C v\u00e0 c\u00e1ch kh\u1eafc ph\u1ee5c?<\/b><\/h3>\n<ul>\n<li><span style=\"font-weight: 400;\">L\u1ed7i c\u00fa ph\u00e1p: \u0110\u1ecdc k\u1ef9 th\u00f4ng b\u00e1o l\u1ed7i t\u1eeb tr\u00ecnh bi\u00ean d\u1ecbch v\u00e0 s\u1eeda l\u1ea1i m\u00e3. C\u00e1c l\u1ed7i c\u00fa ph\u00e1p th\u01b0\u1eddng g\u1eb7p bao g\u1ed3m thi\u1ebfu d\u1ea5u ch\u1ea5m ph\u1ea9y, d\u1ea5u ngo\u1eb7c kh\u00f4ng kh\u1edbp.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">L\u1ed7i ph\u00e2n \u0111o\u1ea1n (Segmentation Fault): X\u1ea3y ra khi truy c\u1eadp v\u00e0o b\u1ed9 nh\u1edb kh\u00f4ng h\u1ee3p l\u1ec7, ch\u1eb3ng h\u1ea1n nh\u01b0 dereferencing m\u1ed9t con tr\u1ecf null ho\u1eb7c v\u01b0\u1ee3t qu\u00e1 ch\u1ec9 s\u1ed1 m\u1ea3ng. Ki\u1ec3m tra c\u00e1c con tr\u1ecf v\u00e0 ch\u1ec9 s\u1ed1 m\u1ea3ng c\u1ea9n th\u1eadn.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">L\u1ed7i logic: Ch\u01b0\u01a1ng tr\u00ecnh ch\u1ea1y nh\u01b0ng kh\u00f4ng cho k\u1ebft qu\u1ea3 nh\u01b0 mong \u0111\u1ee3i. C\u1ea7n ki\u1ec3m tra l\u1ea1i logic c\u1ee7a ch\u01b0\u01a1ng tr\u00ecnh v\u00e0 s\u1eed d\u1ee5ng c\u00e1c c\u00f4ng c\u1ee5 debug \u0111\u1ec3 t\u00ecm hi\u1ec3u v\u1ea5n \u0111\u1ec1.<\/span><\/li>\n<\/ul>\n<h3><b>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 debug ch\u01b0\u01a1ng tr\u00ecnh C hi\u1ec7u qu\u1ea3?<\/b><\/h3>\n<ul>\n<li><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng printf \u0111\u1ec3 in ra c\u00e1c gi\u00e1 tr\u1ecb bi\u1ebfn v\u00e0 theo d\u00f5i d\u00f2ng ch\u1ea3y c\u1ee7a ch\u01b0\u01a1ng tr\u00ecnh.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng c\u00e1c c\u00f4ng c\u1ee5 debug nh\u01b0 GDB (GNU Debugger) \u0111\u1ec3 ki\u1ec3m tra t\u1eebng d\u00f2ng m\u00e3, xem gi\u00e1 tr\u1ecb bi\u1ebfn, v\u00e0 theo d\u00f5i c\u00e1c l\u1ed7i ph\u00e2n \u0111o\u1ea1n.<\/span><\/li>\n<\/ul>\n<h3><b>C \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong nh\u1eefng l\u0129nh v\u1ef1c n\u00e0o?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">H\u1ec7 \u0111i\u1ec1u h\u00e0nh: Nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh nh\u01b0 Unix v\u00e0 Linux \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng C.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Ph\u1ea7n m\u1ec1m nh\u00fang: C\u00e1c thi\u1ebft b\u1ecb nh\u01b0 router, h\u1ec7 th\u1ed1ng \u0111i\u1ec1u khi\u1ec3n t\u1ef1 \u0111\u1ed9ng th\u01b0\u1eddng s\u1eed d\u1ee5ng C.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Tr\u00ecnh bi\u00ean d\u1ecbch: Nhi\u1ec1u tr\u00ecnh bi\u00ean d\u1ecbch v\u00e0 c\u00f4ng c\u1ee5 l\u1eadp tr\u00ecnh \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng C.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">\u1ee8ng d\u1ee5ng khoa h\u1ecdc v\u00e0 k\u1ef9 thu\u1eadt: C \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong c\u00e1c \u1ee9ng d\u1ee5ng \u0111\u00f2i h\u1ecfi t\u00ednh to\u00e1n hi\u1ec7u n\u0103ng cao.<\/span><\/li>\n<\/ul>\n<h3>T\u1ea1i sao n\u00ean h\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n tr\u01b0\u1edbc khi h\u1ecdc C++?<\/h3>\n<p><span style=\"font-weight: 400;\">Ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C v\u00e0 C++ c\u00f3 m\u1ed9t m\u1ed1i quan h\u1ec7 \u0111\u1eb7c bi\u1ec7t ch\u1eb7t ch\u1ebd. C++ \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n nh\u01b0 m\u1ed9t ph\u1ea7n m\u1edf r\u1ed9ng c\u1ee7a C b\u1edfi Bjarne Stroustrup v\u00e0o nh\u1eefng n\u0103m 1980. C++ b\u1ed5 sung nhi\u1ec1u t\u00ednh n\u0103ng m\u1edbi, \u0111\u1eb7c bi\u1ec7t l\u00e0 l\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng, nh\u01b0ng v\u1eabn gi\u1eef l\u1ea1i h\u1ea7u h\u1ebft c\u00fa ph\u00e1p v\u00e0 nguy\u00ean t\u1eafc c\u01a1 b\u1ea3n c\u1ee7a C.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ch\u00ednh v\u00ec v\u1eady, c\u00f3 th\u1ec3 coi C++ nh\u01b0 m\u1ed9t &#8220;phi\u00ean b\u1ea3n n\u00e2ng cao&#8221; c\u1ee7a C. H\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n tr\u01b0\u1edbc s\u1ebd gi\u00fap b\u1ea1n:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>N\u1ec1n t\u1ea3ng v\u1eefng ch\u1eafc:<\/b><span style=\"font-weight: 400;\"> H\u1ecdc C gi\u00fap b\u1ea1n n\u1eafm v\u1eefng nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n nh\u1ea5t c\u1ee7a l\u1eadp tr\u00ecnh nh\u01b0 bi\u1ebfn, h\u00e0m, c\u1ea5u tr\u00fac \u0111i\u1ec1u khi\u1ec3n, v\u00e0 qu\u1ea3n l\u00fd b\u1ed9 nh\u1edb. Nh\u1eefng ki\u1ebfn th\u1ee9c n\u00e0y l\u00e0 n\u1ec1n t\u1ea3ng quan tr\u1ecdng \u0111\u1ec3 hi\u1ec3u s\u00e2u h\u01a1n v\u1ec1 C++.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>C\u00fa ph\u00e1p t\u01b0\u01a1ng t\u1ef1:<\/b><span style=\"font-weight: 400;\"> C v\u00e0 C++ chia s\u1ebb c\u00fa ph\u00e1p v\u00e0 nhi\u1ec1u kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n. Vi\u1ec7c th\u00e0nh th\u1ea1o C gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng ti\u1ebfp c\u1eadn v\u00e0 hi\u1ec3u c\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao trong C++ m\u00e0 kh\u00f4ng g\u1eb7p kh\u00f3 kh\u0103n v\u1ec1 c\u00fa ph\u00e1p.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Hi\u1ec7u su\u1ea5t v\u00e0 t\u1ed1i \u01b0u h\u00f3a:<\/b><span style=\"font-weight: 400;\"> C n\u1ed5i ti\u1ebfng v\u1edbi hi\u1ec7u su\u1ea5t cao v\u00e0 kh\u1ea3 n\u0103ng t\u1ed1i \u01b0u h\u00f3a. H\u1ecdc C tr\u01b0\u1edbc gi\u00fap b\u1ea1n hi\u1ec3u c\u00e1ch vi\u1ebft m\u00e3 t\u1ed1i \u01b0u, qu\u1ea3n l\u00fd b\u1ed9 nh\u1edb hi\u1ec7u qu\u1ea3, nh\u1eefng ki\u1ebfn th\u1ee9c quan tr\u1ecdng khi b\u1ea1n l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c d\u1ef1 \u00e1n l\u1edbn v\u00e0 ph\u1ee9c t\u1ea1p trong C++.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1 h\u1ec7 th\u1ed1ng:<\/b><span style=\"font-weight: 400;\"> C th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ph\u00e1t tri\u1ec3n h\u1ec7 \u0111i\u1ec1u h\u00e0nh v\u00e0 c\u00e1c ph\u1ea7n m\u1ec1m h\u1ec7 th\u1ed1ng. Nh\u1eefng ki\u1ebfn th\u1ee9c n\u00e0y r\u1ea5t h\u1eefu \u00edch khi b\u1ea1n chuy\u1ec3n sang h\u1ecdc C++, \u0111\u1eb7c bi\u1ec7t n\u1ebfu b\u1ea1n l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c \u1ee9ng d\u1ee5ng h\u1ec7 th\u1ed1ng ho\u1eb7c nh\u00fang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u01b0 duy l\u1eadp tr\u00ecnh:<\/b><span style=\"font-weight: 400;\"> C l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh th\u1ee7 t\u1ee5c, gi\u00fap b\u1ea1n ph\u00e1t tri\u1ec3n t\u01b0 duy l\u1eadp tr\u00ecnh c\u00f3 t\u1ed5 ch\u1ee9c v\u00e0 logic. \u0110i\u1ec1u n\u00e0y r\u1ea5t quan tr\u1ecdng khi b\u1ea1n h\u1ecdc l\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng trong C++.<\/span><\/li>\n<\/ul>\n<blockquote><p><em>\u0110\u1ecdc th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/so-sanh-c-va-cpp\/\" target=\"_blank\" rel=\"noopener\"><strong>C v\u00e0 C++: Ph\u00e2n bi\u1ec7t hai ng\u00f4n ng\u1eef qua 5 \u0111i\u1ec3m kh\u00e1c bi\u1ec7t quan tr\u1ecdng<\/strong><\/a><\/em><\/p><\/blockquote>\n<h3><b>C\u00e0i \u0111\u1eb7t m\u00f4i tr\u01b0\u1eddng l\u1eadp tr\u00ecnh C\/C++<\/b><\/h3>\n<h4><b>C\u00e0i \u0111\u1eb7t tr\u00ecnh bi\u00ean d\u1ecbch GCC<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 l\u1eadp tr\u00ecnh C, b\u1ea1n c\u1ea7n m\u1ed9t tr\u00ecnh bi\u00ean d\u1ecbch. GCC (GNU Compiler Collection) l\u00e0 m\u1ed9t trong nh\u1eefng tr\u00ecnh bi\u00ean d\u1ecbch ph\u1ed5 bi\u1ebfn nh\u1ea5t.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tr\u00ean Windows:<\/b><span style=\"font-weight: 400;\"> T\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t MinGW (Minimalist GNU for Windows).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tr\u00ean macOS:<\/b><span style=\"font-weight: 400;\"> S\u1eed d\u1ee5ng Homebrew \u0111\u1ec3 c\u00e0i \u0111\u1eb7t GCC: <\/span><span style=\"font-weight: 400;\">brew install gcc<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tr\u00ean Linux:<\/b><span style=\"font-weight: 400;\"> C\u00e0i \u0111\u1eb7t GCC qua package manager, v\u00ed d\u1ee5: <\/span><span style=\"font-weight: 400;\">sudo apt-get install gcc<\/span><span style=\"font-weight: 400;\"> tr\u00ean Ubuntu.<\/span><\/li>\n<\/ol>\n<h4><b>C\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh visual studio code cho C<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Visual Studio Code l\u00e0 m\u1ed9t IDE m\u1ea1nh m\u1ebd v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng. \u0110\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t Visual Studio Code t\u1eeb<\/span> <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">trang ch\u1ee7<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e0i \u0111\u1eb7t c\u00e1c extension c\u1ea7n thi\u1ebft: &#8220;C\/C++&#8221; v\u00e0 &#8220;Code Runner&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u1ea5u h\u00ecnh task runner \u0111\u1ec3 bi\u00ean d\u1ecbch v\u00e0 ch\u1ea1y ch\u01b0\u01a1ng tr\u00ecnh C.<\/span><\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket_lap_trinh_C_co_ban\"><\/span><b>T\u1ed5ng k\u1ebft l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Qua b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta \u0111\u00e3 c\u00f9ng nhau t\u00ecm hi\u1ec3u c\u00e1c kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n c\u1ee7a l\u1eadp tr\u00ecnh C, t\u1eeb c\u00fa ph\u00e1p c\u01a1 b\u1ea3n, bi\u1ebfn v\u00e0 ki\u1ec3u d\u1eef li\u1ec7u, c\u00e2u l\u1ec7nh \u0111i\u1ec1u ki\u1ec7n, v\u00f2ng l\u1eb7p, m\u1ea3ng v\u00e0 con tr\u1ecf, \u0111\u1ebfn h\u00e0m, c\u1ea5u tr\u00fac v\u00e0 union, l\u00e0m vi\u1ec7c v\u1edbi t\u1ec7p tin, v\u00e0 qu\u1ea3n l\u00fd b\u1ed9 nh\u1edb \u0111\u1ed9ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">L\u1eadp tr\u00ecnh C l\u00e0 m\u1ed9t ng\u00f4n ng\u1eef m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t, m\u1edf ra nhi\u1ec1u c\u01a1 h\u1ed9i trong c\u00e1c l\u0129nh v\u1ef1c c\u00f4ng ngh\u1ec7 kh\u00e1c nhau. Vi\u1ec7c n\u1eafm v\u1eefng c\u00e1c ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n s\u1ebd gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng ti\u1ebfp c\u1eadn v\u00e0 hi\u1ec3u s\u00e2u h\u01a1n c\u00e1c kh\u00e1i ni\u1ec7m n\u00e2ng cao trong l\u1eadp tr\u00ecnh C++, t\u1eeb \u0111\u00f3 m\u1edf ra nhi\u1ec1u c\u01a1 h\u1ed9i ph\u00e1t tri\u1ec3n v\u00e0 s\u00e1ng t\u1ea1o trong l\u0129nh v\u1ef1c c\u00f4ng ngh\u1ec7.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 ti\u1ebfp t\u1ee5c h\u00e0nh tr\u00ecnh h\u1ecdc l\u1eadp tr\u00ecnh, h\u00e3y chuy\u1ec3n sang ph\u1ea7n 2 v\u1edbi c\u00e1c c\u00e2u l\u1ec7nh n\u00e2ng cao trong C++.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C l\u00e0 m\u1ed9t trong nh\u1eefng ng\u00f4n ng\u1eef \u0111\u00e3 l\u00e0m thay \u0111\u1ed5i ho\u00e0n to\u00e0n th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh t\u1eeb nh\u1eefng n\u0103m 1970. \u0110\u01b0\u1ee3c t\u1ea1o ra b\u1edfi Dennis Ritchie t\u1ea1i AT&amp;T Bell Labs, C kh\u00f4ng ch\u1ec9 l\u00e0 n\u1ec1n t\u1ea3ng c\u1ee7a nhi\u1ec1u ng\u00f4n ng\u1eef hi\u1ec7n \u0111\u1ea1i nh\u01b0 C++, Java, v\u00e0 Python, m\u00e0 c\u00f2n l\u00e0 [&hellip;]<\/p>\n","protected":false},"author":222,"featured_media":77060,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-76943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft - ITviec Blog<\/title>\n<meta name=\"description\" content=\"H\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n kh\u00f4ng ch\u1ec9 \u0111\u1ec3 ph\u00e1t tri\u1ec3n c\u00e1c \u1ee9ng d\u1ee5ng m\u1ea1nh m\u1ebd, m\u00e0 c\u00f2n gi\u00fap b\u1ea1n ti\u1ebfp c\u1eadn v\u00e0 hi\u1ec3u nh\u1eefng ng\u00f4n ng\u1eef kh\u00e1c d\u1ec5 d\u00e0ng h\u01a1n.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft\" \/>\n<meta property=\"og:description\" content=\"Ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C l\u00e0 m\u1ed9t trong nh\u1eefng ng\u00f4n ng\u1eef \u0111\u00e3 l\u00e0m thay \u0111\u1ed5i ho\u00e0n to\u00e0n th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh t\u1eeb nh\u1eefng n\u0103m 1970. \u0110\u01b0\u1ee3c t\u1ea1o ra b\u1edfi Dennis Ritchie t\u1ea1i\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-15T07:05:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"790\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nguy\u1ec5n H\u1eefu V\u0103n\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nguy\u1ec5n H\u1eefu V\u0103n\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft - ITviec Blog","description":"H\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n kh\u00f4ng ch\u1ec9 \u0111\u1ec3 ph\u00e1t tri\u1ec3n c\u00e1c \u1ee9ng d\u1ee5ng m\u1ea1nh m\u1ebd, m\u00e0 c\u00f2n gi\u00fap b\u1ea1n ti\u1ebfp c\u1eadn v\u00e0 hi\u1ec3u nh\u1eefng ng\u00f4n ng\u1eef kh\u00e1c d\u1ec5 d\u00e0ng h\u01a1n.","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:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/","og_locale":"vi_VN","og_type":"article","og_title":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft","og_description":"Ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C l\u00e0 m\u1ed9t trong nh\u1eefng ng\u00f4n ng\u1eef \u0111\u00e3 l\u00e0m thay \u0111\u1ed5i ho\u00e0n to\u00e0n th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh t\u1eeb nh\u1eefng n\u0103m 1970. \u0110\u01b0\u1ee3c t\u1ea1o ra b\u1edfi Dennis Ritchie t\u1ea1i","og_url":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-08-15T07:05:45+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg","type":"image\/jpeg"}],"author":"Nguy\u1ec5n H\u1eefu V\u0103n","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Nguy\u1ec5n H\u1eefu V\u0103n","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"12 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/"},"author":{"name":"Nguy\u1ec5n H\u1eefu V\u0103n","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/a77cc13f89eaa58f59d8772448febe5f"},"headline":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft","datePublished":"2024-08-15T07:05:45+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/"},"wordCount":3182,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/","url":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/","name":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg","datePublished":"2024-08-15T07:05:45+00:00","description":"H\u1ecdc l\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n kh\u00f4ng ch\u1ec9 \u0111\u1ec3 ph\u00e1t tri\u1ec3n c\u00e1c \u1ee9ng d\u1ee5ng m\u1ea1nh m\u1ebd, m\u00e0 c\u00f2n gi\u00fap b\u1ea1n ti\u1ebfp c\u1eadn v\u00e0 hi\u1ec3u nh\u1eefng ng\u00f4n ng\u1eef kh\u00e1c d\u1ec5 d\u00e0ng h\u01a1n.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/08\/lap-trinh-c-co-ban-vippro.jpg","width":1500,"height":790,"caption":"l\u1eadp tr\u00ecnh c c\u01a1 b\u1ea3n - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/lap-trinh-c-co-ban\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"L\u1eadp tr\u00ecnh C c\u01a1 b\u1ea3n v\u1edbi c\u00e1c c\u00fa ph\u00e1p C c\u1ea7n bi\u1ebft"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/a77cc13f89eaa58f59d8772448febe5f","name":"Nguy\u1ec5n H\u1eefu V\u0103n","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/TR-Nguyen-Huu-Van-vippro-e1712136004193-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/TR-Nguyen-Huu-Van-vippro-e1712136004193-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/TR-Nguyen-Huu-Van-vippro-e1712136004193-100x100.jpg","caption":"Nguy\u1ec5n H\u1eefu V\u0103n"},"url":"https:\/\/itviec.com\/blog\/author\/nguyen-huu-van-2\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/76943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/222"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=76943"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/76943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/77060"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=76943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=76943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=76943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}