05-NumbersOperators.pptx - ICS 212 Program Structure William McDaniel Albritton M.S Memory Allocation#define Numbers and Operators in C Formatting

05-NumbersOperators.pptx - ICS 212 Program Structure...

This preview shows page 1 - 14 out of 38 pages.

ICS 212 Program Structure William McDaniel Albritton M.S.
Image of page 1
Memory Allocation #define Numbers and Operators in C Formatting Output
Image of page 2
Image of page 3
#define
Image of page 4
#define Usually at the top of the code Used to create symbolic constants Used to create macros
Image of page 5
#define format #define identifier replacement-text All subsequent occurrences of identifier will be replaced before the program is compiled Occurrences that appear in string literals (strings in double-quotes) will not be replaced
Image of page 6
#define PI 3.14159265358979323846 Symbolic Constant Creates a name for a constant in the program NO semi-colon!!!! Redefining a symbolic constant with a new value is an error See example program: define.c
Image of page 7
Macro Macros enable you to name a small instruction and use the name throughout the program. Example: #define AREA b*h More about this later…
Image of page 8
Image of page 9
Numbers and Operators in C
Image of page 10
Data Types are System-Dependent On UH UNIX operating system, we are using GCC GNU Compiler Collection (GCC) is a compiler system, which was created by the GNU Project and supports languages such as C (gcc), C++ (g++), and others %gcc –v gcc version 3.4.6
Image of page 11
Data Types are System-Dependent Integers char Maximum = 127 short Maximum = 32,767 int Maximum = 2,147,483,647 long Maximum = 2,147,483,647 *GCC on UH UNIX
Image of page 12
Data Types are System-Dependent Floating Point float
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 38 pages?

  • Spring '18
  • Long integer,  Numbers,  Occurrences

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes