Getting Started Flashcards

(21 cards)

1
Q

Applications of C

A
  • Operating Systems Linux (Linux written in Assembly and C and MS Windows written in Assembly, C and C++)
  • JVM written in Assembly, C and C++
  • Embedded Systems(cars, caclulators, appliances)
  • High performance applications(science/engineering)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Imperative Language

A
  • Like Java, it is focused on how a computation should be performed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Procedural

A
  • A program is a collection of procedures(functions)
  • Focus on actions performed by these procedures
  • This is C
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Object-oriented

A
  • Program is a collection of objects, each with state and operations
  • Focus on state of tehse objects
  • This is not C
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Declarative Languages

A

Focus on what the program should compute rather than how it should compute it

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

Functional Languages(LSH)

A

Lisp, Scheme, Haskell

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

Dataflow Languages(VLT)

A

VHDL, Linda, TensorFlow

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

Logic/Constraint-Based

A

Prolog

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

Markup Languages

A

HTML, Markdown

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

How we got to C?

A
  • Algol 66 -> BCPL -> B -> C -> C++, Perl; C++ -> Java; C++ & Java -> C#
  • Developed along with the Unix operating system(An alternative to developing OS in Assembly)
  • More portable, readable, maintainable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s C(transitions)

A
  • Informal Standard for 10 years
  • C89 standard in 1989/1990
  • C99 standard in 1999(one we use)
  • C11 completed in 2011
  • C17 completed in 2017
  • Work in C2x is ongoing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

C Strengths

A
  • Think of C as a thin veneer over the underlying assembly language
  • Let’s us do some things we couldn’t do in a higher-level language
  • The standard leaves some details implementation-defined, to better exploit hardware. Ex. C has an int type, but its range may depend on compiler/hardware; C doesn’t generally guarantee what uninitialized variables will contain
  • C compiles much faster since it is compiled down to hardware’s native machine lanugage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

C Weaknesses

A
  • C offers very little in protection and security
  • C lacks some constructs for managing very large projects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Software Tools

A
  • To help write, build, analyze and maintain software
  • Coordinate contributions from a team
    Examples: Editors, pretty printers, compilers, linkers, debuggers. code generators, performance analyzors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The Common Platform(NCSU)

A
  • Different systems have different processors, compilers, language versions, line termination conventions, etc. so we need to agree on what system to target
  • 64-bit Intel PC
  • University Linux OS
  • gcc compiler suite
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Commands for reference

A

Files on Computer to NCSU Shared Drive(sftp)
Terminal to Remote Linux Server(ssh)
NCSU Drive Shared Files to Computer on Campus/NCSU Remote Linux(smb)

17
Q

Sample C Program

A

https://docs.google.com/document/d/1ps52mAqU6IepM0jTIRxM1uVtIvR0R8spKT6Xy_XXDUY/edit?usp=sharing

18
Q

GCC commands to Compile and Execute

A

gcc -Wall -std=c99 hello.c -o hello
./hello
https://docs.google.com/document/d/1ps52mAqU6IepM0jTIRxM1uVtIvR0R8spKT6Xy_XXDUY/edit?usp=sharing

19
Q

Variable Declarations in C

A
  • Variable Declarations look the same as Java
    We have most of the same built-in types, including char, short, int long, float and double. No byte(char instead) and boolean types(C99 gives bool)
  • Before C99 standard, local variables had to be declared at the top of function or block.(Some people still code that way)
20
Q

C you already know: C operations, flow of control loops, file scope(in the doc)

A

https://docs.google.com/document/d/1ps52mAqU6IepM0jTIRxM1uVtIvR0R8spKT6Xy_XXDUY/edit?usp=sharing

21
Q

Variable Initializations in C

A

C doesn’t force you to initialize your local variables and it doesn’t initialize them for you.