from 1 - Digital tools
Published online by Cambridge University Press: 04 August 2010
Purpose
To use a compiler/editor to write and compile a simple C program. To investigate the 2's complement unsigned, and hexadecimal representation of 8-, 16-, and 32-bit numbers, to use the printf function for printed output, and the scanf function for interactive program control and data entry.
Equipment
IBM-compatible Pentium microcomputer with Windows NT operating system and Microsoft Visual C++ compiler
Printer (shared with other laboratory stations)
Additional reading
Appendix C: C programming hints
Section 1.3 Number systems
B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice Hall, Englewood Cliffs, NJ, 1988.
Procedure
Microsoft Visual C++ programming environment
You will need a separate project file and folder for each laboratory exercise that requires programming. Rather than creating your own project folder from scratch, copy a “starter project” folder into your file storage area. The laboratory assistant or teaching associate will tell you where to find it on your local network. This folder contains a starter project file with all the library modules that your project will require, and C code files you may need, such as InitAll and fft.c.
Rename the starter project folder and the .dsw project file in it, but be sure to keep the .dsw extension. Start the Microsoft Visual C++ developer studio by double-clicking the shortcut on the desktop. Open the project by clicking on the “File: Open Workspace” command and select your project .dsw file. “File: Close Workspace” will close the project you are currently working on.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.