{"id":10098,"date":"2015-07-30T09:06:51","date_gmt":"2015-07-30T13:06:51","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=10098"},"modified":"2015-08-04T10:10:44","modified_gmt":"2015-08-04T14:10:44","slug":"c-code-read-file-content","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=10098","title":{"rendered":"C++ code : Read file content"},"content":{"rendered":"<pre>#include &lt;iostream&gt;\r\n#include &lt;fstream&gt;\r\nusing namespace std;\r\n\r\nint main()\r\n{\r\n\u00a0 ifstream in(\"test\", ios::in | ios::binary);\r\n\r\n\u00a0 if(!in) {\r\n\u00a0\u00a0\u00a0 cout &lt;&lt; \"Cannot open input file.\\n\";\r\n\u00a0\u00a0\u00a0 return 1;\r\n\u00a0 }\r\n\r\n\u00a0 double num;\r\n\u00a0 char str[80];\r\n\r\n\u00a0 in.read((char *) &amp;num, sizeof(double));\r\n\u00a0 in.read(str, 14);\r\n\u00a0 str[14] = '\\0'; \/\/ null terminate str\r\n\r\n\u00a0 cout &lt;&lt; num &lt;&lt; ' ' &lt;&lt; str;\r\n\r\n\u00a0 in.close();\r\n\r\n\u00a0 return 0;\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#include &lt;iostream&gt; #include &lt;fstream&gt; using namespace std; int main() { \u00a0 ifstream in(&#8220;test&#8221;, ios::in | ios::binary); \u00a0 if(!in) { \u00a0\u00a0\u00a0 cout &lt;&lt; &#8220;Cannot open input file.\\n&#8221;; \u00a0\u00a0\u00a0 return 1; \u00a0 } \u00a0 double num; \u00a0 char str[80]; \u00a0 in.read((char *) &amp;num, sizeof(double)); \u00a0 in.read(str, 14); \u00a0 str[14] = &#8216;\\0&#8217;; \/\/ null terminate str \u00a0 cout &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=10098\">Continue reading<\/a><\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[446,706,1240,1444,531,445],"class_list":["post-10098","post","type-post","status-publish","format-standard","hentry","category-root","tag-c","tag-code","tag-content","tag-1444","tag-531","tag-445","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10096,"url":"http:\/\/bangla.sitestree.com\/?p=10096","url_meta":{"origin":10098,"position":0},"title":"A simple C++ Program code","author":"","date":"July 29, 2015","format":false,"excerpt":"#include <iostream> #include <fstream> using namespace std; int main() { \u00a0 ifstream in(\"test\", ios::in | ios::binary); \u00a0 if(!in) { \u00a0\u00a0\u00a0 cout << \"Cannot open input file.\\n\"; \u00a0\u00a0\u00a0 return 1; \u00a0 } \u00a0 double num; \u00a0 char str[80]; \u00a0 in.read((char *) &num, sizeof(double)); \u00a0 in.read(str, 14); \u00a0 str[14] = '\\0'; \/\/\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"http:\/\/bangla.sitestree.com\/?cat=1420"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":62221,"url":"http:\/\/bangla.sitestree.com\/?p=62221","url_meta":{"origin":10098,"position":1},"title":"Read file content #Programming Code Examples #C++ #File","author":"Author-Check- Article-or-Video","date":"May 15, 2021","format":false,"excerpt":"#include <iostream> #include <fstream> using namespace std; int main() { ifstream in(\"test\", ios::in | ios::binary); if(!in) { cout << \"Cannot open input file.n\"; return 1; } double num; char str[80]; in.read((char *) &num, sizeof(double)); in.read(str, 14); str[14] = ''; \/\/ null terminate str cout << num << ' ' <<\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":62219,"url":"http:\/\/bangla.sitestree.com\/?p=62219","url_meta":{"origin":10098,"position":2},"title":"A Simple C++ Program #Programming Code Examples #C++ #File","author":"Author-Check- Article-or-Video","date":"May 15, 2021","format":false,"excerpt":"#include <iostream> #include <fstream> using namespace std; int main() { ifstream in(\"test\", ios::in | ios::binary); if(!in) { cout << \"Cannot open input file.n\"; return 1; } double num; char str[80]; in.read((char *) &num, sizeof(double)); in.read(str, 14); str[14] = ''; \/\/ null terminate str cout << num << ' ' <<\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76187,"url":"http:\/\/bangla.sitestree.com\/?p=76187","url_meta":{"origin":10098,"position":3},"title":"C Code Build a Binary Tree.","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <iostream> #include <string.h> #include <stdlib.h> #pragma warning(disable : 4996) #define MaxWordSize 100 \/\/ Declare a structure that holds data in a node typedef struct { char word[MaxWordSize + 1]; } NodeData; typedef struct treeNode { NodeData data; struct treeNode* left, * right; } TreeNode, *TreeNodePtr; typedef struct { TreeNodePtr\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7290,"url":"http:\/\/bangla.sitestree.com\/?p=7290","url_meta":{"origin":10098,"position":4},"title":"\u0987\u09a8\u09aa\u09c1\u099f \u0993 \u0986\u0989\u099f\u09aa\u09c1\u099f . C &#8211; Input &#038; Output","author":"Author-Check- Article-or-Video","date":"March 16, 2015","format":false,"excerpt":"\u0987\u09a8\u09aa\u09c1\u099f \u0993 \u0986\u0989\u099f\u09aa\u09c1\u099f \u0986\u09b0\u09bf\u09ab \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09c7 \u0987\u09a8\u09aa\u09c1\u099f \u09a6\u09c7\u09df\u09be \u09b9\u099a\u09cd\u099a\u09c7 \u09aa\u09cd\u09b0\u0997\u09cd\u09b0\u09be\u09ae\u09c7\u09b0 \u09ae\u09a7\u09cd\u09af\u09c7 \u09a8\u09bf\u099c\u09c7\u09b0 \u09a6\u09c7\u09df\u09be \u09a1\u09be\u099f\u09be \u09a2\u09c1\u0995\u09be\u09a8\u09cb\u0964 \u0986\u09ae\u09b0\u09be \u09ab\u09be\u0987\u09b2 (\u09ab\u09be\u0987\u09b2 \u0987\u09a8\u09aa\u09c1\u099f- \u0986\u0989\u099f\u09aa\u09c1\u099f \u0985\u0982\u09b6\u09c7 \u0986\u09ae\u09b0\u09be \u098f\u099f\u09be \u09b6\u09bf\u0996\u09a4\u09c7 \u09aa\u09be\u09b0\u09ac) \u098f\u09ac\u0982 \u0995\u09ae\u09be\u09a8\u09cd\u09a1 \u09b2\u09be\u0987\u09a8 \u09a6\u09c1\u09ad\u09be\u09ac\u09c7\u0987 \u09a1\u09be\u099f\u09be \u09a6\u09bf\u09a4\u09c7 \u09aa\u09be\u09b0\u09bf \u0964 \u098f\u099c\u09a8\u09cd\u09af\u09c7 \u09b8\u09bf \u098f\u09b0 \u0995\u09bf\u099b\u09c1 \u09ac\u09bf\u09b2\u09cd\u09a1-\u0987\u09a8 \u09ab\u09be\u0982\u09b6\u09a8 \u0986\u099b\u09c7\u0964 \u0986\u09b0 \u0985\u0989\u099f\u09aa\u09c1\u099f \u09b9\u099a\u09cd\u099b\u09c7 \u0986\u09ae\u09be\u09a6\u09c7\u09b0 \u09a6\u09c7\u09df\u09be \u0987\u09a8\u09aa\u09c1\u099f \u09a1\u09be\u099f\u09be \u0995\u09ae\u09cd\u09aa\u09bf\u0989\u099f\u09be\u09b0 \u09b8\u09cd\u0995\u09cd\u09b0\u09bf\u09a8\u09c7 \u09ac\u09be \u09aa\u09cd\u09b0\u09bf\u09a8\u09cd\u099f\u09be\u09b0\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11097,"url":"http:\/\/bangla.sitestree.com\/?p=11097","url_meta":{"origin":10098,"position":5},"title":"\u09aa\u09be\u0987\u09a5\u09a8 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 : \u09b8\u09cd\u099f\u09cd\u09b0\u09bf\u0982 (Python Strings in Bangla)","author":"","date":"October 27, 2015","format":false,"excerpt":"1.10 Python Strings Accessing Values in Strings \u09a8\u09bf\u099a\u09c7\u09b0 \u0995\u09cb\u09a1\u099f\u09bf \u09b2\u0995\u09cd\u09b7\u09cd\u09af \u0995\u09b0\u09bf, #!\/usr\/bin\/python var1 = 'Hello World!' var2 = \"Python Programming\" print \"var1[0]: \", var1[0] print \"var2[1:5]: \", var2[1:5] \u00a0 \u0989\u09aa\u09b0\u09c7\u09b0 \u0995\u09cb\u09a1\u099f\u09bf \u09b0\u09be\u09a8 \u0995\u09b0\u09be\u09b2\u09c7 \u09a8\u09bf\u099a\u09c7\u09b0 \u09ab\u09b2\u09be\u09ab\u09b2 \u09aa\u09cd\u09b0\u09bf\u09a8\u09cd\u099f \u09b9\u09ac\u09c7\u0964 var1[0]:\u00a0 H var2[1:5]:\u00a0 ytho \u00a0 Updating Strings \u0985\u09a8\u09cd\u09af \u098f\u0995\u099f\u09bf \u09b8\u09cd\u099f\u09cd\u09b0\u09bf\u0982 \u098f\u09b0 \u09b8\u09be\u09a5\u09c7 \u0995\u09cb\u09a8\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/bangla.sitestree.com\/?cat=1613"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/130"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10098"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10098\/revisions"}],"predecessor-version":[{"id":10614,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10098\/revisions\/10614"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10098"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}