Skip navigation

Solution: Print a range of numbers

Solution: Print a range of numbers: C Essential Training
Solution: Print a range of numbers: C Essential Training

Join for an in-depth discussion in this video Solution: Print a range of numbers, part of C Essential Training.

Resume Transcript Auto-Scroll
Skill Level Beginner
7h 22m
Duration
890,978
Views
Show More Show Less

Q: How do I configure a C compiler in Windows?

<div>To configure a C compiler for Eclipse in Windows, follow these steps: </div><div>1) Download the MinGW installer from <a target="_blank" href="http://sourceforge.net/projects/mingw/files/latest/download?source=files">http://sourceforge.net/projects/mingw/files/latest/download?source=files.</a> </div><div>2) Open the resulting mingw-get-setup.exe file and click <strong>Continue</strong> until you get to the Installation Manager. </div><div>3) Select mingw32-base and choose <strong>Mark for Installation</strong>. </div><div>4) Under the <strong>Installation</strong> menu, choose <strong>Apply Changes </strong>and then <strong>Apply</strong>. Wait for the process to complete. </div><div>5) Open Eclipse and navigate to the <strong>Preferences</strong> option under the <strong>Window</strong> menu. </div><div>6) Under <strong>C/C++</strong>, find the <strong>New C/C++ Project Wizard</strong> option. For the <strong>Hello World ANSI C Project</strong> option, choose the <strong>MinGW GCC</strong> toolchain, and click <strong>Make toolchain(s) preferred</strong>. Press <strong>OK</strong>. </div><div>7) To create a new project, select the <strong>File</strong> menu and choose <strong>New C Project</strong>. </div><div> 8) In the <strong>Project Type</strong> area, choose <strong>Hello World ANSI C Project</strong>, and specify a project name. Press <strong>Finish</strong>. This will create a .c file inside a folder named &#8220;src.&#8221; </div><div>9) Open the exercise file and copy and paste the contents into the .c file created inside of your project, replacing the contents. </div>

Q: How do I use the exercise files on a Windows machine?

A: On Windows, the exercise files require a change to the compiler settings to enable C99 support. To change the compiler settings, follow these steps:<br /><br />&nbsp;&nbsp;&nbsp; 1)&nbsp;&nbsp;&nbsp; Right-click on the .c file and choose <strong>Properties</strong>.<br />&nbsp;&nbsp;&nbsp; 2)&nbsp;&nbsp;&nbsp; Under <strong>C/C++ Build</strong> and <strong>Settings</strong>, change the <strong>Command</strong> value to &#8232;&#8220;gcc -std=c99&#8221;. Click OK.

Skills covered in this course
Developer Programming Languages C

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start Your Free Trial Now

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now