<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>Angel's Blog</title>
	<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php" />
	<modified>2026-05-13T17:36:32Z</modified>
	<author>
		<name>Angel</name>
	</author>
	<copyright>Copyright 2026, Angel</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.7.0">SPHPBLOG</generator>
	<entry>
		<title>C 101: Foreach loop macro</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry230403-182101" />
		<content type="text/html" mode="escaped"><![CDATA[<pre>[acool@localhost ~]$ <br />[acool@localhost ~]$ date<br />Mon Apr  3 11:17:50 AM PDT 2023<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ cat c-foreach-macro.c <br />#include &lt;stdio.h&gt;<br /><br />#define foreach(item, array) \<br />    for(int keep = 1, \<br />            count = 0,\<br />            size = sizeof (array) / sizeof *(array); \<br />        keep &amp;&amp; count != size; \<br />        keep = !keep, count++) \<br />      for(item = (array) + count; keep; keep = !keep)<br /><br />int main()<br />{<br />    int mynumbers[] = {5,20,35,62,8,74,89};<br />    <br />    char mygreeting[] = {&quot;Hello world!&quot;};<br /><br />    float myfloats[] = {1.6,6.9,5.8,43.5,1.1,0.9};<br /><br />    foreach(int *v, mynumbers) {<br />        printf(&quot;value: %d\n&quot;, *v);<br />    }<br /><br />    foreach(char *v, mygreeting) {<br />        printf(&quot;value: %c\n&quot;, *v);<br />    }<br /><br />    foreach(float *v, myfloats) {<br />        printf(&quot;value: %.2f\n&quot;, *v);<br />    }<br /><br />    return 0;<br />}<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ gcc c-foreach-macro.c -o c-foreach-macro<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ ./c-foreach-macro <br />value: 5<br />value: 20<br />value: 35<br />value: 62<br />value: 8<br />value: 74<br />value: 89<br />value: H<br />value: e<br />value: l<br />value: l<br />value: o<br />value:  <br />value: w<br />value: o<br />value: r<br />value: l<br />value: d<br />value: !<br />value: <br />value: 1.60<br />value: 6.90<br />value: 5.80<br />value: 43.50<br />value: 1.10<br />value: 0.90<br />[acool@localhost ~]$</pre><br /><br />Bonus - dumping output from preprocessor.<br /><pre>[acool@localhost ~]$ <br />[acool@localhost ~]$ gcc c-foreach-macro.c -E -o c-macro.preprocessed<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ cat c-macro.preprocessed<br />...<br />int main()<br />{<br />    int mynumbers[] = {5,20,35,62,8,74,89};<br /><br />    char mygreeting[] = {&quot;Hello world!&quot;};<br /><br />    float myfloats[] = {1.6,6.9,5.8,43.5,1.1,0.9};<br /><br />    for(int keep = 1, count = 0, size = sizeof (mynumbers) / sizeof *(mynumbers); keep &amp;&amp; count != size; keep = !keep, count++) for(int *v = (mynumbers) + count; keep; keep = !keep) {<br />        printf(&quot;value: %d\n&quot;, *v);<br />    }<br /><br />    for(int keep = 1, count = 0, size = sizeof (mygreeting) / sizeof *(mygreeting); keep &amp;&amp; count != size; keep = !keep, count++) for(char *v = (mygreeting) + count; keep; keep = !keep) {<br />        printf(&quot;value: %c\n&quot;, *v);<br />    }<br /><br />    for(int keep = 1, count = 0, size = sizeof (myfloats) / sizeof *(myfloats); keep &amp;&amp; count != size; keep = !keep, count++) for(float *v = (myfloats) + count; keep; keep = !keep) {<br />        printf(&quot;value: %.2f\n&quot;, *v);<br />    }<br /><br />    return 0;<br />}<br />[acool@localhost ~]$ <br /></pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry230403-182101</id>
		<issued>2023-04-03T00:00:00Z</issued>
		<modified>2023-04-03T00:00:00Z</modified>
	</entry>
	<entry>
		<title>C 101: Creating Child Processes With A Loop</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry221023-231122" />
		<content type="text/html" mode="escaped"><![CDATA[<pre>#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;unistd.h&gt;<br />#include &lt;sys/wait.h&gt;<br /><br />void child( int seconds );<br /><br />int children = 15;<br /><br />int main(void)<br />{<br />  printf(&quot;Parent ID %d, Main ID %d \n&quot;, getppid(), getpid()); <br /><br />  for(int i=0;i&lt;children;i++)<br />  {<br />    if(fork()==0)<br />    {<br />      child(children-i); // pass seconds to sleep<br />    }<br />    else<br />    {<br />      wait(NULL);<br />    }<br />  }<br />}<br /><br />void child(int seconds)<br />{<br />  printf(&quot;Parent ID %d, Child ID %d, Sleeping %d seconds.\n&quot;, getppid(), getpid(), seconds); <br />  sleep(seconds);<br />  exit(0);<br />}</pre><br /><pre>[acool@localhost C-Exercises]$ date<br />Sun Oct 23 04:14:24 PM PDT 2022<br />[acool@localhost C-Exercises]$<br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ gcc parent_children.c <br />[acool@localhost C-Exercises]$ ./a.out <br />Parent ID 4298, Main ID 10357 <br />Parent ID 10357, Child ID 10358, Sleeping 15 seconds.<br />Parent ID 10357, Child ID 10394, Sleeping 14 seconds.<br />Parent ID 10357, Child ID 10436, Sleeping 13 seconds.<br />Parent ID 10357, Child ID 10475, Sleeping 12 seconds.<br />Parent ID 10357, Child ID 10510, Sleeping 11 seconds.<br />Parent ID 10357, Child ID 10532, Sleeping 10 seconds.<br />Parent ID 10357, Child ID 10546, Sleeping 9 seconds.<br />Parent ID 10357, Child ID 10558, Sleeping 8 seconds.<br />Parent ID 10357, Child ID 10581, Sleeping 7 seconds.<br />Parent ID 10357, Child ID 10598, Sleeping 6 seconds.<br />Parent ID 10357, Child ID 10607, Sleeping 5 seconds.<br />Parent ID 10357, Child ID 10613, Sleeping 4 seconds.<br />Parent ID 10357, Child ID 10647, Sleeping 3 seconds.<br />Parent ID 10357, Child ID 10732, Sleeping 2 seconds.<br />Parent ID 10357, Child ID 10815, Sleeping 1 seconds.<br />[acool@localhost C-Exercises]$<br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ ps -A |grep a.out<br />  10357 pts/0    00:00:00 a.out<br />  10394 pts/0    00:00:00 a.out<br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ pstree -p 10357<br />a.out(10357)───a.out(10436)<br />[acool@localhost C-Exercises]$ <br /></pre><br />Slightly different version, in this version we don&#039;t wait() for each child individually.<br /><pre>#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;unistd.h&gt;<br />#include &lt;sys/wait.h&gt;<br /><br />void child( int seconds );<br /><br />int children = 15;<br /><br />int main(void)<br />{<br />  printf(&quot;Parent ID %d, Main ID %d \n&quot;, getppid(), getpid()); <br /><br />  for(int i=0;i&lt;children;i++)<br />  {<br />    if(fork()==0)<br />    {<br />      child(children-i); // pass seconds to sleep<br />    }<br />  }<br /><br />  while (wait(NULL) &gt; 0); // wait for all children to finish<br />}<br /><br />void child(int seconds)<br />{<br />  printf(&quot;Parent ID %d, Child ID %d, Sleeping %d seconds.\n&quot;, getppid(), getpid(), seconds); <br />  sleep(seconds);<br />  exit(0);<br />}</pre><br /><pre>[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ gcc parent_children.c <br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ ./a.out <br />Parent ID 4298, Main ID 14322 <br />Parent ID 14322, Child ID 14323, Sleeping 15 seconds.<br />Parent ID 14322, Child ID 14324, Sleeping 14 seconds.<br />Parent ID 14322, Child ID 14325, Sleeping 13 seconds.<br />Parent ID 14322, Child ID 14326, Sleeping 12 seconds.<br />Parent ID 14322, Child ID 14327, Sleeping 11 seconds.<br />Parent ID 14322, Child ID 14328, Sleeping 10 seconds.<br />Parent ID 14322, Child ID 14329, Sleeping 9 seconds.<br />Parent ID 14322, Child ID 14330, Sleeping 8 seconds.<br />Parent ID 14322, Child ID 14331, Sleeping 7 seconds.<br />Parent ID 14322, Child ID 14332, Sleeping 6 seconds.<br />Parent ID 14322, Child ID 14333, Sleeping 5 seconds.<br />Parent ID 14322, Child ID 14334, Sleeping 4 seconds.<br />Parent ID 14322, Child ID 14335, Sleeping 3 seconds.<br />Parent ID 14322, Child ID 14336, Sleeping 2 seconds.<br />Parent ID 14322, Child ID 14337, Sleeping 1 seconds.<br />[acool@localhost C-Exercises]$<br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ pstree -p 14322<br />a.out(14322)─┬─a.out(14323)<br />             ├─a.out(14324)<br />             ├─a.out(14325)<br />             ├─a.out(14326)<br />             ├─a.out(14327)<br />             ├─a.out(14328)<br />             ├─a.out(14329)<br />             ├─a.out(14330)<br />             ├─a.out(14331)<br />             ├─a.out(14332)<br />             ├─a.out(14333)<br />             ├─a.out(14334)<br />             └─a.out(14335)<br />[acool@localhost C-Exercises]$ ps -A |grep a.out<br />  14322 pts/0    00:00:00 a.out<br />  14323 pts/0    00:00:00 a.out<br />  14324 pts/0    00:00:00 a.out<br />  14325 pts/0    00:00:00 a.out<br />  14326 pts/0    00:00:00 a.out<br />  14327 pts/0    00:00:00 a.out<br />  14328 pts/0    00:00:00 a.out<br />  14329 pts/0    00:00:00 a.out<br />  14330 pts/0    00:00:00 a.out<br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ <br />[acool@localhost C-Exercises]$ pstree -p 14322<br />a.out(14322)─┬─a.out(14323)<br />             ├─a.out(14324)<br />             ├─a.out(14325)<br />             ├─a.out(14326)<br />             ├─a.out(14327)<br />             └─a.out(14328)<br />[acool@localhost C-Exercises]$<br />[acool@localhost C-Exercises]$</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry221023-231122</id>
		<issued>2022-10-23T00:00:00Z</issued>
		<modified>2022-10-23T00:00:00Z</modified>
	</entry>
	<entry>
		<title>C101: Printing Emojis</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry221022-190423" />
		<content type="text/html" mode="escaped"><![CDATA[<pre>#include &lt;stdio.h&gt;<br />#include &lt;wchar.h&gt;<br />#include &lt;locale.h&gt;<br /><br />// multibyte array, each character is 4 bytes long<br />wchar_t mystring[] = L&quot;Angel Cool á 🤪 😁 ა&quot;;<br /><br />// [acool@localhost other]$ gcc -Wall -ggdb emoji-multibyte-array.c -o emoji-multibyte-array<br />int main()<br />{<br />    setlocale(LC_ALL,&quot;&quot;);<br /><br />    // print total number of characters in string<br />    wprintf(L&quot;wcslen of wchar_t mystring[]: %ld\n&quot;, wcslen(mystring));<br /><br />    // output string<br />    wprintf(L&quot;%ls\n&quot;,mystring);<br /><br />    // print one character<br />    wprintf(L&quot;Emoji : %lc\n&quot;, mystring[13]);<br /><br />    // print all <br />    for (int j = 0; j &lt; wcslen(mystring); ++j)<br />    {<br />        wprintf(L&quot;%lc,&quot;, mystring[j]);<br />    }<br /><br />    wprintf(L&quot;\n&quot;);<br /><br />    // size in bytes of string, it also includes 4 bytes for the null (\0) characters at the end it seems <br />    wprintf(L&quot;Size in bytes of mystring[]: %d\n&quot;, sizeof(mystring));<br /><br />    // print size of wchar_t data type<br />    wprintf(L&quot;wchar_t is %d bytes long!\n&quot;, sizeof(wchar_t));<br /><br />    return 0;<br />}</pre><br /><pre>[acool@localhost other]$ date<br />Sat Oct 22 12:05:24 PM PDT 2022<br />[acool@localhost other]$ gcc emoji-multibyte-array.c <br />[acool@localhost other]$ ./a.out <br />wcslen of wchar_t mystring[]: 18<br />Angel Cool á 🤪 😁 ა<br />Emoji : 🤪<br />A,n,g,e,l, ,C,o,o,l, ,á, ,🤪, ,😁, ,ა,<br />Size in bytes of mystring[]: 76<br />wchar_t is 4 bytes long!<br />[acool@localhost other]$</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry221022-190423</id>
		<issued>2022-10-22T00:00:00Z</issued>
		<modified>2022-10-22T00:00:00Z</modified>
	</entry>
	<entry>
		<title>C 101: Preventing Zombie Processes </title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry220923-200117" />
		<content type="text/html" mode="escaped"><![CDATA[<pre>#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;unistd.h&gt;<br />#include &lt;sys/types.h&gt;<br />#include &lt;sys/wait.h&gt;<br /><br />int main()<br />{<br />    pid_t pid;<br />    int status;<br /><br />    pid = fork();<br /><br />    if(pid&lt;0)<br />    {<br />        printf(&quot;Error: fork() returned %u.\n&quot;, pid);<br />        return 1;<br />    }<br /><br />    if(pid == 0)<br />    {<br />        printf(&quot;Child: PID is %u. Parent&#039;s PID is %u\n&quot;, getpid(), getppid());<br />        sleep(10);<br />        puts(&quot;Child: about to exit.\n&quot;);<br />        return 33;<br />    }<br />    else<br />    {<br />        printf(&quot;Parent: PID is %u. Child&#039;s PID is %u\n&quot;, getpid(), pid);<br /><br />        while((pid=waitpid(-1,&amp;status,WNOHANG)) == 0)<br />        {<br />            printf(&quot;Parent: No child has terminated.&quot;);<br />            printf(&quot;Parent: Going to sleep for 1 second.\n&quot;);<br />            sleep(1);<br />        }<br />    }<br /><br />    printf(&quot;Parent: child with PID %u &quot;, pid);<br /><br />    if(WIFEXITED(status)!=0)<br />    {<br />        printf(&quot;exited with status %u\n&quot;,WIFEXITED(status));<br />    }<br />    else<br />    {<br />        printf(&quot;exited abnormally\n&quot;);<br />    }<br /><br />    return 0;<br />}<br /></pre><br />Preventing Zombie Processes Using waitpid()<br />Listing 19.5 -Teach Yourself C For Linux Programming<br /><pre>[acool@localhost C-practice]$ gcc -Wall fork.c<br />[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ ./a.out <br />Parent: PID is 57544. Child&#039;s PID is 57545<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Child: PID is 57545. Parent&#039;s PID is 57544<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Parent: No child has terminated.Parent: Going to sleep for 1 second.<br />Child: about to exit.<br /><br />Parent: child with PID 57545 exited with status 1<br />[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry220923-200117</id>
		<issued>2022-09-23T00:00:00Z</issued>
		<modified>2022-09-23T00:00:00Z</modified>
	</entry>
	<entry>
		<title>C 101: Creating Structures</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry220823-035202" />
		<content type="text/html" mode="escaped"><![CDATA[Method 1:<br /><pre>// define it as a template<br />struct person {<br /> char first_name[50];<br /> char last_name[50];<br />};<br /><br />// create two instances of person<br />struct person Person1, Person2;<br /><br />// assign values to Person1<br />strcpy(Person1.first_name, &quot;Angel&quot;);<br />strcpy(Person1.last_name, &quot;Cool&quot;);<br /></pre><br />Method 2:<br /><pre>// define it and create two instances of it<br />struct car {<br /> char make[50];<br /> char color[50];<br />} Car1, Car2;<br /><br />// assign values to Car1<br />strcpy(Car1.make, &quot;Chevy&quot;);<br />strcpy(Car1.color, &quot;red&quot;);<br /></pre><br />Method 3:<br /><pre>// use &#039;typedef&#039; to create it<br />typedef struct {<br /> char first_name[50];<br /> char last_name[50];<br />} person;<br /><br />// create two instances of person (no &#039;struct&#039; keyword needed)<br />person Person1, Person2;<br /></pre><br />Method 1 example<br /><pre>[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ cat method_1.c <br />#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br /><br />void main(){<br />    struct person {<br />      char first_name[50];<br />      char last_name[50];<br />    };<br /><br />    // create two instances of person<br />    struct person Person1, Person2;<br /><br />    // assign values to Person1<br />    strcpy(Person1.first_name, &quot;Angel&quot;);<br />    strcpy(Person1.last_name, &quot;Cool&quot;);<br />    <br />    // print assigned values <br />    printf(&quot;Hello %s %s!\n&quot;, Person1.first_name, Person1.last_name);<br />}<br />[acool@localhost C-practice]$ gcc method_1.c -o method_1<br />[acool@localhost C-practice]$ ./method_1 <br />Hello Angel Cool!<br />[acool@localhost C-practice]$ <br /></pre><br />Method 2 example<br /><pre>[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ cat method_2.c <br />#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br /><br />void main(){<br />    // define it and create two instances of it<br />    struct car {<br />      char make[50];<br />      char color[50];<br />    } Car1, Car2;<br /><br />    // assign values to Car1<br />    strcpy(Car1.make, &quot;Chevy&quot;);<br />    strcpy(Car1.color, &quot;red&quot;);<br /><br />    // print assigned values<br />    printf(&quot;My %s %s.\n&quot;,Car1.color, Car1.make);<br />}<br />[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ gcc method_2.c -o method_2<br />[acool@localhost C-practice]$ ./method_2<br />My red Chevy.<br />[acool@localhost C-practice]$ </pre><br />Method 3 example<br /><pre>[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ cat method_3.c <br />#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br /><br />void main(){<br />    // use &#039;typedef&#039; to create it<br />    typedef struct {<br />      char first_name[50];<br />      char last_name[50];<br />    } person;<br /><br />    // create two instances of person (no &#039;struct&#039; keyword needed)<br />    person Person1, Person2;<br /><br />    // assign values to Person1<br />    strcpy(Person1.first_name, &quot;Andres Manuel&quot;);<br />    strcpy(Person1.last_name, &quot;Lopez-Obrador&quot;);<br /><br />    printf(&quot;Viva la 4T! Viva %s %s!\n&quot;, Person1.first_name, Person1.last_name);<br />}<br />[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ gcc method_3.c -o method_3<br />[acool@localhost C-practice]$ ./method_3<br />Viva la 4T! Viva Andres Manuel Lopez-Obrador!<br />[acool@localhost C-practice]$ <br />[acool@localhost C-practice]$ </pre><br /><br />Another example:<br /><pre>[acool@localhost ~]$ <br />[acool@localhost ~]$ <br />[acool@localhost ~]$ date<br />Wed Apr  5 02:18:30 PM PDT 2023<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ cat books.c <br />#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;stdlib.h&gt;<br /><br />struct Books {<br />    char title[50];<br />    char author[50];<br />    char subject[100];<br />    int id;<br />};<br /><br />typedef struct {<br />    char title[50];<br />    char author[50];<br />    char subject[100];<br />    int id;<br />} eBooks;<br /><br />void printdetails(eBooks *myEbook, struct Books *myBook)<br />{<br />  printf( &quot;myBook id : %d\n&quot;, myBook-&gt;id);<br />  printf( &quot;myBook title : %s\n&quot;, myBook-&gt;title);<br />  printf( &quot;myBook author : %s\n&quot;, myBook-&gt;author);<br />  printf( &quot;myBook subject : %s\n&quot;, myBook-&gt;subject);<br />  <br />  printf(&quot;====================================\n&quot;);<br /><br />  printf( &quot;myEbook id : %d\n&quot;, myEbook-&gt;id);<br />  printf( &quot;myEbook title : %s\n&quot;, myEbook-&gt;title);<br />  printf( &quot;myEbook author : %s\n&quot;, myEbook-&gt;author);<br />  printf( &quot;myEbook subject : %s\n&quot;, myEbook-&gt;subject);<br />}<br /><br />int main()<br />{<br />    // Pay attention to this! ...two different ways to declare it.<br />   struct Books *myBook = (struct Books *) malloc(sizeof(struct Books));<br />   eBooks *myEbook = (eBooks *) malloc(sizeof(eBooks));<br /><br />   strcpy( myBook-&gt;title, &quot;C Programming&quot;);<br />   strcpy( myBook-&gt;author, &quot;Angel Cool&quot;); <br />   strcpy( myBook-&gt;subject, &quot;Programming C Structs Examples&quot;);<br />   myBook-&gt;id = 1;<br /> <br />   strcpy( myEbook-&gt;title, &quot;C Programming (eBook)&quot;);<br />   strcpy( myEbook-&gt;author, &quot;Angel Cool (eBook)&quot;); <br />   strcpy( myEbook-&gt;subject, &quot;Programming C Structs Examples (eBook)&quot;);<br />   myEbook-&gt;id = 2;<br /> <br />   printdetails(myEbook,myBook);<br /><br />   return 0;<br />}<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ <br />[acool@localhost ~]$ gcc books.c -o books<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ ./books <br />myBook id : 1<br />myBook title : C Programming<br />myBook author : Angel Cool<br />myBook subject : Programming C Structs Examples<br />====================================<br />myEbook id : 2<br />myEbook title : C Programming (eBook)<br />myEbook author : Angel Cool (eBook)<br />myEbook subject : Programming C Structs Examples (eBook)<br />[acool@localhost ~]$ <br />[acool@localhost ~]$ file books<br />books: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ea1090588d4c761da3060066a7d7a67b7db9caa6, for GNU/Linux 3.2.0, not stripped<br />[acool@localhost ~]$ <br />[acool@localhost ~]$</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry220823-035202</id>
		<issued>2022-08-23T00:00:00Z</issued>
		<modified>2022-08-23T00:00:00Z</modified>
	</entry>
</feed>
