Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>question 1)</p> <p>the header file <code>&lt;stdio.h&gt;</code> is included in order to have reference to the input/output function from C library. The <code>&lt;stdio.h&gt;</code> contains only function references and not the definition of the functions. The <code>&lt;stdio.h&gt;</code> contains references to functions like:</p> <ul> <li><p><code>printf</code> (out) output to <code>stdout</code> (default: screen)</p></li> <li><p><code>scanf</code> (in) reading from <code>stdin</code> (default: keyboard)</p></li> </ul> <p>question 2)</p> <p><code>char *argv[]</code> is an array of pointer. Each pointer element is pointing to a string. Each string is an argument from the command line.</p> <p>Example: If your program name after compilation is "myprogram" and you calling your program as following:</p> <pre><code>$myprogram -t test1 test2 </code></pre> <p>So the <code>argv</code> is an array containing 4 pointers to the following string</p> <p><code>argv[0]</code> is a pointer to the string "myprogram"</p> <p><code>argv[1]</code> is a pointer to the string "-t"</p> <p><code>argv[2]</code> is a pointer to the string "test1"</p> <p><code>argv[3]</code> is a pointer to the string "test2"</p> <p>question 3)</p> <p><code>%d</code> means integer and not double. For double you can use <code>%lf</code> or <code>%g</code></p> <p>question 4)</p> <p><code>%s</code> means that you are printing string</p> <p>example related to <code>argv</code>:</p> <pre><code>printf("argv[0] = %s\n", argv[0]); printf("argv[1] = %s\n", argv[1]); printf("argv[2] = %s\n", argv[2]); printf("argv[3] = %s\n", argv[3]); </code></pre> <p>based on question 2 the above prints give the following output:</p> <pre><code>argv[0] = myprogram argv[1] = -t argv[2] = test1 argv[3] = test2 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload