{"id":5466,"date":"2018-11-08T15:05:00","date_gmt":"2018-11-08T20:05:00","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=5466"},"modified":"2018-11-08T15:05:00","modified_gmt":"2018-11-08T20:05:00","slug":"example-of-a-structure-in-c","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2018\/11\/08\/example-of-a-structure-in-c\/","title":{"rendered":"Example of a structure in C"},"content":{"rendered":"<p>This is just a placeholder for  how these work.  Largely, this is the predecessor of object oriented programming in that a structure has properties that can be assigned.<\/p>\n<pre>\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\nstruct student {\r\n\u00a0 int studentId;\r\n\u00a0 char studentName[40];\r\n\u00a0 float pct;\r\n};\r\n\r\nint main() {\r\n\u00a0 int i;\r\n\u00a0 struct student record1 = {1, \"First\", 84.3};\r\n\u00a0 struct student record2 = {2, \"Second\", 80.6};\r\n\u00a0 struct student *ptr;\r\n\r\n\u00a0 ptr = &record1;\r\n\r\n\u00a0 printf(\"\u00a0 Id is: %d \\n\", ptr->studentId);\r\n\u00a0 printf(\"\u00a0 Name is: %s \\n\", ptr->studentName);\r\n\u00a0 printf(\"\u00a0 Percentage is: %f \\n\\n\", ptr->pct);\r\n\u00a0 printf(\"%x\\n\", ptr);\r\n\r\n\u00a0 ptr = &record2;\r\n\r\n\u00a0 printf(\"\u00a0 Id is: %d \\n\", ptr->studentId);\r\n\u00a0 printf(\"\u00a0 Name is: %s \\n\", ptr->studentName);\r\n\u00a0 printf(\"\u00a0 Percentage is: %f \\n\\n\", ptr->pct);\r\n\u00a0 printf(\"%x\\n\", ptr);\r\n\u00a0 return 0;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is just a placeholder for how these work. Largely, this is the predecessor of object oriented programming in that a structure has properties that can be assigned. #include #include struct student { \u00a0 int studentId; \u00a0 char studentName[40]; \u00a0&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2018\/11\/08\/example-of-a-structure-in-c\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[105,24],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5466"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5466"}],"version-history":[{"count":3,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5466\/revisions"}],"predecessor-version":[{"id":6784,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5466\/revisions\/6784"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5466"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}