{"id":76179,"date":"2024-07-20T20:13:15","date_gmt":"2024-07-21T00:13:15","guid":{"rendered":"https:\/\/bangla.sitestree.com\/?p=76179"},"modified":"2024-07-28T17:02:54","modified_gmt":"2024-07-28T21:02:54","slug":"struct-record-examples-in-c-programming-language","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76179","title":{"rendered":"Struct\/Record Examples in C Programming Language"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#pragma warning(disable : 4996)\n#include &lt;iostream>\n#include &lt;string.h>\n\n\/\/struct\nstruct student {\n\tchar name&#91;50];\n\tint age;\n\tfloat height;\n};\n\nstruct student s1 = { \" Nina Chase\", 12, 1.55 };\nstruct student s2 = { \" Shyann Morris\", 12, 1.65 };\n\n\/\/typedef struct\ntypedef struct {\n\tchar name&#91;50];\n\tint age;\n\tfloat height;\n} studentType;\n\nstudentType s11 = { \" Nina Chase\", 12, 1.55 };\nstudentType s22 = { \" Shyann Morris\", 12, 1.65 };\n\n\/\/typedef struct\ntypedef struct studentTypeStart {\n\tchar name&#91;50];\n\tint age;\n\tfloat height;\n} studentTypeEnd;\n\nstudentTypeEnd s33 = { \" Shyann Morris\", 12, 1.65 };\nstruct studentTypeStart s44 = { \" struct studentTypeStart Shyann Morris\", 12, 1.65 };\nstudentTypeStart s55 = { \" Shyann Morris studentTypeStart\", 12, 1.65 };\n\nstudentTypeEnd *stuPtr;\n\n\n\/\/ main method\nint main()\n{\n\tstd::cout &lt;&lt; \"Hello World 2!\\n\";\n\tstd::cout &lt;&lt; s11.name &lt;&lt; \"\\n\";\n\tstd::cout &lt;&lt; s33.name &lt;&lt; \"\\n\";\n\tstd::cout &lt;&lt; s55.name &lt;&lt; \"\\n\";\n\tstd::cout &lt;&lt; s44.name &lt;&lt; \"\\n\";\n\t\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1966,1883,182],"tags":[],"class_list":["post-76179","post","type-post","status-publish","format-standard","hentry","category-data-structure-and-algorithms","category---data-structure","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":76183,"url":"http:\/\/bangla.sitestree.com\/?p=76183","url_meta":{"origin":76179,"position":0},"title":"Struct and Tree Node Examples","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <iostream> #include <string.h> #pragma warning(disable : 4996) #define MaxWordSize 100 \/\/ Declare a structure that holds data in a node typedef struct { int num; } NodeDataInt; \/\/ Declare a structure that holds data in a node typedef struct { char word[MaxWordSize + 1]; int freq; } NodeDataChar; \/\/\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":76181,"url":"http:\/\/bangla.sitestree.com\/?p=76181","url_meta":{"origin":76179,"position":1},"title":"Struct and Tree Node","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"\/\/ Ref: typedef and struct \/\/ https:\/\/www.w3resource.com\/c-programming-exercises\/c-snippets\/difference-between-typedef-struct-and-struct-definitions-with-example.php#google_vignette \/\/ https:\/\/www.tutorialspoint.com\/cprogramming\/c_pointers.htm \/\/ https:\/\/www.geeksforgeeks.org\/typedef-in-c\/ #pragma warning(disable : 4996) #include <iostream> #include <string.h> \/\/ Declare a structure that holds data in a node typedef struct { int num; } NodeData; \/\/ define what a node will look like typedef struct treenode { NodeData data;\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":76173,"url":"http:\/\/bangla.sitestree.com\/?p=76173","url_meta":{"origin":76179,"position":2},"title":"Nodes: Vertices and Edges. Nodes for them","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"define MaxWordSize 100 #define MaxWordSize 100 \/\/edge of a graph typedef struct gEdge{ \/\/ child is the location of the child vertex int child, weight; struct gEdge *nextEdge; } GEdge, *GEdgePtr; typedef struct{ char id[MaxWordSize]; int parent, cost, discover, finish, inDegree; GEdgePtr firstEdge; } GVertex; \/\/main method int main() {\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":76185,"url":"http:\/\/bangla.sitestree.com\/?p=76185","url_meta":{"origin":76179,"position":3},"title":"A Binary Tree Declaration","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <stdio.h> #include <stdlib.h> \/\/ Declare a structure that holds data in a node typedef struct { int num; } NodeData; typedef struct treeNode { NodeData data; struct treeNode* left, * right; } TreeNode, *TreeNodePtr; typedef struct { TreeNodePtr root; } BinaryTree; \/\/ main method int main() { \/\/ NULL\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":76187,"url":"http:\/\/bangla.sitestree.com\/?p=76187","url_meta":{"origin":76179,"position":4},"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":8374,"url":"http:\/\/bangla.sitestree.com\/?p=8374","url_meta":{"origin":76179,"position":5},"title":"\u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0999\u09c7 typedef \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0","author":"Author-Check- Article-or-Video","date":"April 4, 2015","format":false,"excerpt":"\u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0999\u09c7 typedef \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0983 \u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u09b2\u09cd\u09af\u09be\u0999\u09cd\u0997\u09c1\u09df\u09c7\u099c typedef \u09a8\u09be\u09ae\u09c7\u09b0 \u098f\u0995\u099f\u09bf \u0995\u09bf-\u0993\u09df\u09be\u09b0\u09cd\u09a1 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09a4\u09c7 \u09a6\u09c7\u09df, \u09af\u09be \u09a8\u09a4\u09c1\u09a8 \u09a8\u09be\u09ae \u099f\u09be\u0987\u09aa \u0995\u09b0\u09a4\u09c7 \u09a6\u09c7\u09df, \u09a8\u09bf\u099a\u09c7\u09b0 \u0989\u09a6\u09be\u09b9\u09b0\u09a3\u09c7 BYTE \u099f\u09be\u09b0\u09cd\u09ae \u09ac\u09bf\u09ac\u09c3\u09a4 \u0995\u09b0\u09be \u09b9\u09df\u09c7\u099b\u09c7\u0964 typedef unsigned char BYTE; \u09ac\u09bf\u09ac\u09c3\u09a4 \u0995\u09b0\u09be\u09b0 \u09aa\u09b0 unsigned char \u098f\u09b0 \u09ac\u09cd\u09af\u09be\u0996\u09cd\u09af\u09be \u09b9\u09bf\u09b8\u09be\u09ac\u09c7 BYTE identifier \u09b0\u09c2\u09aa\u09c7 \u0995\u09be\u099c \u0995\u09b0\u09c7\u0964 \u09af\u09c7\u09ae\u09a8, BYTE\u2026","rel":"","context":"In &quot;\u09aa\u09cd\u09b0\u09be\u09a5\u09ae\u09bf\u0995 \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u0964 C Programming Basics&quot;","block_context":{"text":"\u09aa\u09cd\u09b0\u09be\u09a5\u09ae\u09bf\u0995 \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u0964 C Programming Basics","link":"http:\/\/bangla.sitestree.com\/?cat=239"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76179","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\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76179"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76179\/revisions"}],"predecessor-version":[{"id":76180,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76179\/revisions\/76180"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76179"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}