Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is what I suggest:</p> <ol> <li><strong>Compile your program first.</strong> Your compiler will return most of your errors (the important ones, at least).</li> <li><strong>Pay attention to your use of curly bases.</strong> In C (and in many other languages), the compiler will treat lines that follow other lines linearly. The curly braces cause a multidimensional interpretation. As a beginner to programming, you should practice using curly braces where you can, just so you get into the habit of segregating instructions. Also, you should pay close attention to <strong>matching</strong> your open curly braces with your closed curly braces. For more information, you should see the <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf" rel="nofollow"><strong>C Standard, 6.8: Statements and Blocks</strong></a>.</li> <li>Your <code>switch()</code> block should end with a <code>default:</code> value, just in case you reach a choice that's unexpected. </li> <li>I don't suggest putting your functions prototype inside your <code>main()</code> procedure. It has to do with scopes. Check this out, from <strong>Section 6.2.1</strong> of the standard.</li> </ol> <blockquote> <p>2 For each different entity that an identifier designates, the identifier is visible (i.e., can be used) only within a region of program text called its scope. Different entities designated by the same identifier either have different scopes, or are in different name spaces. There are four kinds of scopes: function, file, block, and function prototype. (A function prototype is a declaration of a function that declares the types of its parameters.)</p> </blockquote> <p>I don't know what else to tell you. Try what I proposed in order. Make sure you read the standard though. As a final suggestion: try programming in a more ordered manner. Your code won't look so sloppy if you keep coding under the intent of wanting to make something you can read by the time you're finished. </p> <p>Good luck.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. 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