C Programming 01/2 Flashcards

1
Q

What is #include?

A

Pre-processor directive which inserts a file into the source code. These are commonly called ‘header files’ and given the extension ‘.h’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is #define?

A

Pre-processor directive which allows the definition of macros within your source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between declare and defining?

A

Declaring a variable or function creates the name but no value/functionality
Defining a variable or function creates the name and associated value/functionality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a function prototype?

A

A function prototype lets you declare a function, without its body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a header file?

A

A file which is designed to be included in multiple files, and often contain function prototypes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is typedef?

A
Use typedef to give new names to types
e.g
typedef oldname newname1, newname2;
or
typedef unsigned int day, month;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is casting?

A
  • Converts a value from one type to another.
  • Casting may be implicit or explicit.
  • There is no error checking on casting.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is static?

A

This variable or function is unique to this file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is extern?

A

This variable will be declared in some other file but I will use it here

How well did you know this?
1
Not at all
2
3
4
5
Perfectly