mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-01-12 08:08:25 +00:00
[SPCA] Start C syntax summary
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
I can clearly C why you'd want to use C. Already sorry in advance for all the bad C jokes that are going to be part of this section
|
||||
|
||||
\texttt{C} is a compiled, low-level programming language, lacking many features modern high-level programming languages offer, like Object Oriented programming, true Functional Programming, Garbage Collection, complex abstract datatypes and vectors, just to name a few. (It is possible to replicate these, more on this later).
|
||||
\texttt{C} is a compiled, low-level programming language, lacking many features modern high-level programming languages offer, like Object Oriented programming,
|
||||
true Functional Programming (like Haskell implements), Garbage Collection, complex abstract datatypes and vectors, just to name a few.
|
||||
(It is possible to replicate these using Preprocessor macros, more on this later).
|
||||
|
||||
On the other hand, it offers the ability to directly integrate assembly code into the \texttt{.c} files, as well as bit level data manipulation and extensive memory management options, again just to name a few.
|
||||
On the other hand, it offers the ability to directly integrate assembly code into the \texttt{.c} files,
|
||||
as well as bit level data manipulation and extensive memory management options, again just to name a few.
|
||||
|
||||
This of course leads to \texttt{C} performing excellently and there are many programming languages who's compiler doesn't directly produce machine code or assembly, but instead optimized \texttt{C} code that is then compiled into machine code using a \texttt{C} compiler.
|
||||
This has a number of benefits, most notably that \texttt{C} compilers can produce very efficient assembly, as lots of effort is put into the \texttt{C} compilers by the hardware manufacturers.
|
||||
This of course leads to \texttt{C} performing excellently and there are many programming languages who's compiler doesn't directly produce machine code or assembly,
|
||||
but instead optimized \texttt{C} code that is then compiled into machine code using a \texttt{C} compiler.
|
||||
This has a number of benefits, most notably that \texttt{C} compilers can produce very efficient assembly,
|
||||
as lots of effort is put into the \texttt{C} compilers by the hardware manufacturers.
|
||||
|
||||
6
semester3/spca/parts/00_c/01_syntax.tex
Normal file
6
semester3/spca/parts/00_c/01_syntax.tex
Normal file
@@ -0,0 +1,6 @@
|
||||
\subsection{The Syntax}
|
||||
\texttt{C} uses a very similar syntax as many other programming languages, like \texttt{Java}, \texttt{JavaScript} and many more\dots
|
||||
to be precise, it is \textit{them} that use the \texttt{C} syntax, not the other way around. So:
|
||||
\inputcodewithfilename{c}{code-examples/00_c/01_syntax/}{00_intro.c}
|
||||
\inputcodewithfilename{c}{code-examples/00_c/01_syntax/}{01_func.h}
|
||||
\inputcodewithfilename{c}{code-examples/00_c/01_syntax/}{01_func.c}
|
||||
Reference in New Issue
Block a user