Unit 2 C Programming Flashcards

1
Q

What are the three main concepts of C

A

How to use POINTERS
Importance of MEMORY ALLOCATION
The use of STRUCTS

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

To which language do these concepts transfer to?

A

C++

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

What is C++ made up of

A
  1. The low level language of C
  2. The standard library and the Standard Template Library
  3. The ability to define your own types and user object-oriented software development
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When did C first appear

A

1972

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

What is declared in the standard headers?

A

Functions, types and macros

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

How do you access the standard header?

A

include <header.h> // this is deprecated</header.h>

#include <cheader> // this is the new valid import statement</cheader>

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

What is the CRT?

A

C Run Time Library

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

What is the point of including
#define CRT_SECURE_NO_WARNINGS

A

It tells the compiler that we do not want suggested secure warnings when using scanf();

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

How do you declare the main scope in C

A

int main() {

}

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

What do you return when the program exited with success

A

return 0;

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

How do you import the C standard input/output library?

A

include <stdio.h></stdio.h>

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

How many Primitive build-in types does C have?

A

13

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

What are the different types of data and how many are there per category

A

Integer Types - 8
Char Types - 2
Floating Point Types - 3

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

What are the integer types and their sizes

A

int 4 bytes
short int 2 Bytes
long int 4 Bytes
long long int 8 Bytes

All of these with the prefix unsigned

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

What are the 2 char types and their sizes

A

char 1 Byte
unsigned char 1 Byte

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

What are the 3 floating-point types

A

Float 4 Bytes
Double 8 Bytes
Long Double 16 Bytes

17
Q

What steps are required to turn source code into a functional program written in C

A
  1. Write the source code in an IDE
  2. The code goes through a preprocessor that re-writes the source code
  3. Goes through a compiler which steps through the program generating assembly language for the specific processor
  4. An assembler will convert the assemblyu code into pure binary or machine code. This is known as the object code
  5. A linker merges all the object code from multiple modules int one. It creates the executable file