Lecture 1: C Flashcards
programming quality standards are?
- correctness, or whether our code solves our problem correctly
- design, or how well-written our code is, based on how efficient and readable it is
- style, or how well-formatted our code is visually
What is compiler?
- Acompiler is a program that can convert one language to another, such as source code to machine code:
<img></img>
In C,mainachieves a similar effect as the Scratch block which is
when green flag clicked
there are a number of commands (Tirminal window) we might use llike:
- cd, for changing our current directory (folder)
- cp, for copying files and directories
- ls, for listing files in a directory
- mkdir, for making a directory
- mv, for moving (renaming) files and directories
- rm, for removing (deleting) files
- rmdir, for removing (deleting) directories
bool is a type of data which represents
a Boolean expression of eithertrueorfalse
Char is a type of data which represents
a single character likeaor2
Double is a type of data which represents
a floating-point value with more digits than afloat
float is a type of data which represents
a floating-point value, or real number with a decimal value
int is a type of data which represents
integers up to a certain size, or number of bits
long is a type of data which represents
integers with more bits, so they can count higher than anint
String is a type of data that represents
array of characters
Forprintf, too, there are different placeholders for each type of data, called:
format codes:
- %cfor chars
- %ffor floats or doubles
- %ifor ints
- %lifor long integers
- %sfor strings
//
comments
how many bits are include in int?
int uses 32 bits, which can only contain about four billion different values (2m psitive numbers & 2m negative numbers)
How many equals sings should used to compare two values in C?
== (2)