You are on page 1of 1

4/9/14

CMSC216 Lecture

Use mv a.out NewName to rename a.out to NewName to prevent future overwrites


o You can run the executable by typing NewName
gcc FileName.c o NewExecutableName will compile FileName.c into executable with
name NewExecutableName
o Do not make the new executable name the same as FileName.c
Will overwrite the program
Press q to stop a program? Or ctrl+c?
Use up arrow to go to previous command
#include will increase size of file
o < > is for standard system files
Do not edit the same file in two windows
gcc is more than compiler
o It is preprocessor, compiler, and linker
Data types in C
o In C, data sizes can change from computer to computer
o Only one data type has a fixed size, which is char (1 byte)
o Char < short < int < long
o float x = 2.5; will covert 2.5 to 2.5f
Numeric literals
Style
o Leave one space before and after stuff like =, -, +
o Leave a blank line between variable declarations and rest of program
o Leave blank line before return statement