{"id":8116,"date":"2023-02-05T22:17:16","date_gmt":"2023-02-05T20:17:16","guid":{"rendered":"https:\/\/blue.pri.ee\/ttu\/?p=8116"},"modified":"2026-02-16T09:43:15","modified_gmt":"2026-02-16T07:43:15","slug":"pr2en3-structures","status":"publish","type":"post","link":"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/","title":{"rendered":"PR2EN3: Structures"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\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:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Lab_materials\" >Lab materials<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Lab_tasks\" >Lab tasks<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Lab_task_W03-1_employee_search\" >Lab task [W03-1]: employee search<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Data_file\" >Data file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Requirements\" >Requirements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Hints\" >Hints<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Example_output\" >Example output<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Extra_task_1_W03-2_List_available_cities\" >Extra task 1 [W03-2]: List available cities<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Extra_task_2_W03-3_Better_search\" >Extra task 2 [W03-3]: Better search<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Extra_task_3_W03-4_Parse_the_eID\" >Extra task 3 [W03-4]: Parse the eID<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#After_the_class_you_should\" >After the class, you should<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/#Additional_content\" >Additional content<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Lab_materials\"><\/span>Lab materials<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Slides: <strong><a href=\"https:\/\/blue.pri.ee\/ttu\/files\/iax0584\/slaidid-en\/03_structures.pdf\">Structures<\/a><\/strong><\/li>\n<li>Additional example:\u00a0<strong><a href=\"https:\/\/blue.pri.ee\/ttu\/programming-ii\/code-samples\/structure-array-example\/\">structure array (includes passing struct arrays to functions)<\/a><\/strong><\/li>\n<\/ul>\n<p>In the lab, a sample solution will be written together and commented where data fill be read from the file and stored in a struct array. This is also published as a code example for those not participating in the lab<strong>:\u00a0<a href=\"https:\/\/blue.pri.ee\/ttu\/programming-ii\/code-samples\/reading-from-a-file-into-structure-array\/\">Reading from a file into structure array<\/a><\/strong><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lab_tasks\"><\/span>Lab tasks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this lab, you have one task which is expanded by three extra tasks.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Lab_task_W03-1_employee_search\"><\/span>Lab task [W03-1]: employee search<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The purpose of this task is to introduce you to using structures. The task will mimic a very basic employee database where the user can search for employees and that also supports commands.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Data_file\"><\/span>Data file<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Download the test data from the following link <strong><a href=\"https:\/\/blue.pri.ee\/ttu\/files\/iax0584\/andmefailid\/3_data_short.zip\">https:\/\/blue.pri.ee\/ttu\/files\/iax0584\/andmefailid\/3_data_short.zip<\/a><\/strong><\/p>\n<p>Data file is composed of randomly generated data.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Requirements\"><\/span>Requirements<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>Read employee data from the file\n<ul>\n<li>Reading the data file more than once within your program is not permitted.<\/li>\n<li>File has one record per line<\/li>\n<li>Every data field is separated by a space. All data fields are single word.<\/li>\n<li>Data structure in the file:<br \/>\n<span class=\"lang:default highlight:0 decode:true crayon-inline\">&lt;eID&gt; &lt;first_name&gt; &lt;last_name&gt; &lt;city&gt;<\/span><\/li>\n<\/ul>\n<\/li>\n<li>The data needs to be kept in the memory as a struct array<\/li>\n<li>Program must work in a situation where the exact number of records is unknown and can change (e.g. somebody gets employed, fired or leaves)\n<ul>\n<li>Create a reasonable limit in your program and test<\/li>\n<li>If the data file is longer than the allowed limit, print a corresponding message. Behavior after this is up to you.<\/li>\n<\/ul>\n<\/li>\n<li>The program must allow for repeated searches and processing of commands without restarting the application<\/li>\n<li>Allow the operator to perform searches based on the city name\n<ul>\n<li>Program will output all employees in the city<\/li>\n<li>Show how many matches were found (E.g. [0 \/ 91])<\/li>\n<li>Search must be repeatable without exiting and restarting the program<\/li>\n<li>In the base task, print all the data available &#8211; eID, last name, first name, city<\/li>\n<\/ul>\n<\/li>\n<li>There must be support for commands\n<ul>\n<li>Commands should start with a &#8220;:&#8221; to identify them from city searches<\/li>\n<li>Command &#8220;:all&#8221; must print all people in the database, without any filtering<\/li>\n<li>Command &#8220;:exit&#8221; must close the program<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"Hints\"><\/span>Hints<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>The command parser sounds &#8220;scary&#8221;, while the solution is extremely simple. All of this you learned in Programming 1 in the strings class. This is a 3-step process<\/p>\n<ol>\n<li>Identify that user entered a command (check that the 0-th character is &#8216;:&#8217;) &#8211; this was an example on the slide<\/li>\n<li>Make a pointer to the second character (<span class=\"lang:c decode:true crayon-inline \">char *command = input + 1;<\/span> )-\u00a0 this is pointer arithmetic from week 1, also used in week 2 for the file extension<\/li>\n<li>Compare the command to known commands<\/li>\n<\/ol>\n<h4><span class=\"ez-toc-section\" id=\"Example_output\"><\/span>Example output<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>The first example is about command handling. If it cannot recognize a command, it states so. If a command is entered without a colon, it will search instead (default behavior).<\/p>\n<pre class=\"theme:cisco-router toolbar:2 nums:false lang:default highlight:0 decode:true\">risto@risto-lt:~\/pr2\/wk3_struct1$ .\/task_basic 03_data_short.txt  \r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n\r\nEnter a city name to search or a command\r\n&gt; :add   \r\n\r\nError! Unknown command!\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n\r\nEnter a city name to search or a command\r\n&gt; exit\r\n\r\nSearching for: exit\r\n\r\nEmployees listed [0\/150]\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n\r\nEnter a city name to search or a command\r\n&gt; :exit\r\n\r\nristo@risto-lt:~\/pr2\/wk3_struct1$ .\/task_basic 03_data_short.txt<\/pre>\n<p>The second example shows how searching is handled.<\/p>\n<pre class=\"theme:cisco-router toolbar:2 nums:false lang:default highlight:0 decode:true\">risto@risto-lt:~\/pr2\/wk3_struct1$ .\/task_basic 03_data_short.txt \r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n\r\nEnter a city name to search or a command\r\n&gt; Sindi\r\n\r\nSearching for: Sindi\r\n\r\nSaar, Anne\r\nCity: Sindi\r\neID: 49112012007\r\n\r\nMitt, Keit\r\nCity: Sindi\r\neID: 48012281578\r\n\r\nKallas, Ivari\r\nCity: Sindi\r\neID: 50107042125\r\n\r\nEmployees listed [3\/150]\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n\r\nEnter a city name to search or a command\r\n&gt; :exit\r\n<\/pre>\n<p>Note that the output of <span class=\"lang:c highlight:0 decode:true  crayon-inline \">:all<\/span>\u00a0 command is not shown due to it being somewhat long.<\/p>\n<p>The last example shows the program when all extra tasks have been completed. This is wrapped in a spoiler to reduce the size on normal vieweing.<\/p>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see the complete output<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">\n<pre class=\"theme:cisco-router toolbar:2 nums:false lang:default highlight:0 decode:true \">risto@risto-lt:~\/pr2\/wk3_struct1$ .\/task_extra 03_data_short.txt Available commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n        :list  | print list of cities\r\n\r\nEnter a city name to search or a command\r\n&gt; sindi\r\n\r\nSearching for: sindi\r\n\r\nSaar, Anne\r\nCity: Sindi\r\nSex: Male\r\nDate of birth: 1. December 1991\r\n\r\nMitt, Keit\r\nCity: Sindi\r\nSex: Male\r\nDate of birth: 28. December 1980\r\n\r\nKallas, Ivari\r\nCity: Sindi\r\nSex: Female\r\nDate of birth: 4. July 2001\r\n\r\nEmployees listed [3\/150]\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n        :list  | print list of cities\r\n\r\nEnter a city name to search or a command\r\n&gt; :list\r\n\r\nList of cities: \r\nAbja-Paluoja\r\nAbjaku\r\nAntsla\r\nElva\r\nHaapsalu\r\nKallaste\r\nKarksi\r\nKarksi-Nuia\r\nKehra\r\nKeila\r\nKunda\r\nKuressaare\r\nLihula\r\nLoksa\r\nMaardu\r\nMustvee\r\nNarva\r\nPaide\r\nPaldiski\r\nRakvere\r\nRapla\r\nSaue\r\nSindi\r\nSuure-Jaani\r\nSuure-Kambja\r\nSuure-Rakke\r\nSuure-Rootsi\r\nSuurekivi\r\nSuuremetsa\r\nSuurepsi\r\nSuuresadama\r\nSuuresta\r\nTallinn\r\nTamsalu\r\nTapa\r\nTartu\r\nValga\r\nViljandi\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n        :list  | print list of cities\r\n\r\nEnter a city name to search or a command\r\n&gt; ALL\r\n\r\nSearching for: all\r\n\r\nMichal, Peeter\r\nCity: Tallinn\r\nSex: Female\r\nDate of birth: 10. May 2003\r\n\r\nSaks, Meelis\r\nCity: Kallaste\r\nSex: Female\r\nDate of birth: 2. December 1943\r\n\r\nToom, Aivar\r\nCity: Kallaste\r\nSex: Female\r\nDate of birth: 8. March 1963\r\n\r\nPuusepp, Anneli\r\nCity: Tallinn\r\nSex: Male\r\nDate of birth: 12. July 1963\r\n\r\nRoos, Arvo\r\nCity: Tallinn\r\nSex: Female\r\nDate of birth: 27. November 1974\r\n\r\nHein, Jelena\r\nCity: Kallaste\r\nSex: Male\r\nDate of birth: 2. November 2000\r\n\r\nRatas, Olga\r\nCity: Kallaste\r\nSex: Male\r\nDate of birth: 1. October 1982\r\n\r\nTomson, Mailis\r\nCity: Tallinn\r\nSex: Male\r\nDate of birth: 7. August 1969\r\n\r\nEmployees listed [8\/150]\r\n\r\nAvailable commands\r\n        :exit  | close the program\r\n        :all   | print everyone in the database\r\n        :list  | print list of cities\r\n\r\nEnter a city name to search or a command\r\n&gt; :exit\r\n\r\n<\/pre>\n<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Extra_task_1_W03-2_List_available_cities\"><\/span>Extra task 1 [W03-2]: List available cities<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Requirements<\/p>\n<ul>\n<li>List all the cities present in the file<\/li>\n<li>List of the cities must be generated based on the data file (cannot be hardcoded into the program)<\/li>\n<li>List of cities must be ordered alphabetically<\/li>\n<li>Add a command &#8220;:list&#8221; to your command parser.<\/li>\n<li>Operator must be able to repeatedly print out the list during the runtime of the program<\/li>\n<li>The list of the cities can only be composed once per execution of the program<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Extra_task_2_W03-3_Better_search\"><\/span>Extra task 2 [W03-3]: Better search<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Requirements<\/p>\n<ul>\n<li>The search must be case-insensitive. Searching for either\u00a0 <span class=\"lang:default highlight:0 decode:true crayon-inline\">TALLINN<\/span>\u00a0 or <span class=\"lang:default highlight:0 decode:true crayon-inline\">tallinn<\/span>\u00a0 must print all employees living in Tallinn.<\/li>\n<li>Search must support partial matches. E.g. when searching for\u00a0 <span class=\"lang:default highlight:0 decode:true crayon-inline\">all<\/span> , you should display employees living both in Kallaste and Tallinn.<\/li>\n<li>Both features must working at the same time. The last result should also be obtainable by entering <span class=\"lang:default highlight:0 decode:true crayon-inline\">ALL<\/span> or <span class=\"lang:default highlight:0 decode:true crayon-inline\">aLL<\/span>.<br \/>\n<strong>NB! Notice that <span class=\"lang:c highlight:0 decode:true crayon-inline \">:all<\/span>\u00a0 is a command printing everyone and <span class=\"lang:c highlight:0 decode:true crayon-inline \">all<\/span>\u00a0 is a search phrase printing people in Tallinn and Kallaste.<\/strong><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Extra_task_3_W03-4_Parse_the_eID\"><\/span>Extra task 3 [W03-4]: Parse the eID<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Requirements<\/p>\n<ul>\n<li>Do not display the eID in the output of your program<\/li>\n<li>Display the employees date of birth with the format <span class=\"lang:default highlight:0 decode:true crayon-inline\">d. MMMM yyyy<\/span><\/li>\n<\/ul>\n<p>Official information about eID: <strong><a href=\"https:\/\/www.riigiteataja.ee\/akt\/114022017005\">https:\/\/www.riigiteataja.ee\/akt\/114022017005<\/a><\/strong><\/p>\n<p>Short description of it in English: <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/National_identification_number#Estonia\">https:\/\/en.wikipedia.org\/wiki\/National_identification_number#Estonia<\/a><\/strong><\/p>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see date and time format guide<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">\n<p>m &#8211; Minutes from 0 to 59.<br \/>\nmm &#8211; Minutes from 00 to 59. Minutes from 0 to 9 are prefixed with a zero.<\/p>\n<p>h &#8211; Hour from 1 &#8211; 12.<br \/>\nhh &#8211; Hour from 01 to 12. Hours from 1 to 9 are prefixed with a zero.<br \/>\nH &#8211; Hour from 0 &#8211; 23<br \/>\nHH &#8211; Hour from 00 &#8211; 23. Hours from 0 to 9 are prefixed with a zero.<\/p>\n<p>d &#8211; Day from 1 to 31<br \/>\ndd &#8211; Day from 01 to 31. Days from 1 to 9 are prefixed with a zero.<br \/>\nddd &#8211; Day as a short name (Mon, Tue, Wed, &#8230;)<br \/>\ndddd &#8211; Day as a long name (Monday, Tuesday, Wednesday, &#8230;)<\/p>\n<p>M &#8211; Month from 1 to 12<br \/>\nMM &#8211; Month from 01 to 12. Months from 1 &#8211; 9 are prefixed with a zero.<br \/>\nMMM &#8211; Month as a short name (Jan, Feb, Mar, Apr, &#8230;)<br \/>\nMMMM &#8211; Month as a full name (January, February, March, &#8230;)<\/p>\n<p>y &#8211; Year from 0 to 99<br \/>\nyy &#8211; Year from 00 to 99<br \/>\nyyy &#8211; Year with a minimum of 3 digits (1 -&gt; 001; 15 -&gt; 015; 145 -&gt; 145; 1949 -&gt; 1949)<br \/>\nyyyy &#8211; Year with 4 digits<\/p>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"After_the_class_you_should\"><\/span>After the class, you should<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Know how to declare a new structure type<\/li>\n<li>Know how to pick members for a structure<\/li>\n<li>Know what is structure padding and how it affects the size of the structure<\/li>\n<li>Know what affects the final size of a structure<\/li>\n<li>Know which structure member access exist and be able to use the dot operator<\/li>\n<li>Know how to create an array of structures and read data from a file into that array of structures<\/li>\n<li>Know how to assign structures<\/li>\n<li>Know how to give existing types new names (use typedef)<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Additional_content\"><\/span>Additional content<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Structures in C<br \/>\n<strong><a href=\"https:\/\/www.geeksforgeeks.org\/structures-c\/\">https:\/\/www.geeksforgeeks.org\/structures-c\/<\/a><\/strong><\/li>\n<li>Structure Member Alignment, Padding and Data Packing<br \/>\n<strong><a href=\"https:\/\/www.geeksforgeeks.org\/structure-member-alignment-padding-and-data-packing\/\">https:\/\/www.geeksforgeeks.org\/structure-member-alignment-padding-and-data-packing\/<\/a><\/strong><\/li>\n<li>Typedef in C<br \/>\n<strong><a href=\"https:\/\/www.geeksforgeeks.org\/typedef-in-c\/\">https:\/\/www.geeksforgeeks.org\/typedef-in-c\/<\/a><\/strong><\/li>\n<li>Why to avoid typedefs with structs (by Linus Torvalds, author of Linux Kernel and Git)<br \/>\n<strong><a href=\"https:\/\/yarchive.net\/comp\/linux\/typedefs.html\">https:\/\/yarchive.net\/comp\/linux\/typedefs.html<\/a><\/strong><\/li>\n<li>Structure padding in C<br \/>\n<strong><a href=\"https:\/\/www.scaler.com\/topics\/structure-padding-in-c\/\">https:\/\/www.scaler.com\/topics\/structure-padding-in-c\/<\/a><\/strong><\/li>\n<li>C structures<br \/>\n<strong><a href=\"https:\/\/www.tutorialspoint.com\/cprogramming\/c_structures.htm\">https:\/\/www.tutorialspoint.com\/cprogramming\/c_structures.htm<\/a><br \/>\n<\/strong><\/li>\n<li>Comprehensive list of date and time formats used in .Net.<br \/>\n<strong><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/base-types\/custom-date-and-time-format-strings\">https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/base-types\/custom-date-and-time-format-strings<\/a><\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Lab materials Slides: Structures Additional example:\u00a0structure array (includes passing struct arrays to functions) In the lab, a sample solution will be written together and commented where data fill be read from the file and stored in a struct array. This is also published as a code example for those not participating in the lab:\u00a0Reading from &hellip; <a href=\"https:\/\/blue.pri.ee\/ttu\/labs\/pr2en3-structures\/\" class=\"more-link\">Loe edasi <span class=\"screen-reader-text\">PR2EN3: Structures<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75,105],"tags":[],"class_list":["post-8116","post","type-post","status-publish","format-standard","hentry","category-labs","category-pr2_en"],"_links":{"self":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/posts\/8116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/comments?post=8116"}],"version-history":[{"count":25,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/posts\/8116\/revisions"}],"predecessor-version":[{"id":11221,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/posts\/8116\/revisions\/11221"}],"wp:attachment":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/media?parent=8116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/categories?post=8116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/tags?post=8116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}