more code examples

This commit is contained in:
lukas-heiligenbrunner 2020-04-17 11:53:35 +02:00
parent cd931da5ad
commit 61b982aa14
2 changed files with 36 additions and 115 deletions

View File

@ -48,7 +48,7 @@
stringstyle=\color{red}\ttfamily, stringstyle=\color{red}\ttfamily,
commentstyle=\color{OliveGreen!85}\ttfamily, commentstyle=\color{OliveGreen!85}\ttfamily,
numberstyle=\tiny\color{codegray}, numberstyle=\tiny\color{codegray},
basicstyle=\small\selectfont\ttfamily, basicstyle=\footnotesize\selectfont\ttfamily,
% keyword highlighting % keyword highlighting
classoffset=1, % starting new class classoffset=1, % starting new class
otherkeywords={>,<,.,;,-,+,!,=,~,:,[,],NULL,&}, otherkeywords={>,<,.,;,-,+,!,=,~,:,[,],NULL,&},
@ -85,6 +85,7 @@
% SECTION 1 % SECTION 1
%---------------------------------------------------------------------------------------- %----------------------------------------------------------------------------------------
\section{Strukturen} % Section title slide, unnumbered \section{Strukturen} % Section title slide, unnumbered
%------------------------------------------------ %------------------------------------------------
@ -95,10 +96,10 @@
%------------------------------------------------ %------------------------------------------------
\begin{frame}[fragile]{Strukturen in C} \begin{frame}[fragile, allowframebreaks]{C Syntax}
Syntax: Definition:
\begin{lstlisting} \begin{lstlisting}
struct adresse { struct Adresse {
char name[50]; char name[50];
char strasse[100]; char strasse[100];
short hausnummer; short hausnummer;
@ -106,6 +107,27 @@ struct adresse {
char stadt[50]; char stadt[50];
}; };
\end{lstlisting} \end{lstlisting}
Anwendung:
\begin{lstlisting}
// Variable der Struktur erstellen
struct Adresse adresseKurt;
// Zugriff auf die Elemente
strcpy(adresseKurt.name, "Kurt Kanns");
adresseKurt.hausnummer = 23;
adresseKurt.plz = 45678;
\end{lstlisting}
\framebreak
Typdefinition mit typedef:
\begin{lstlisting}
typedef struct Adresse {
char name[50];
short hausnummer;
} ADR;
ADR a1,a2;
\end{lstlisting}
\end{frame} \end{frame}
\begin{frame}{Sonstiges} \begin{frame}{Sonstiges}
@ -137,121 +159,19 @@ struct adresse {
% SECTION 2 % SECTION 2
%---------------------------------------------------------------------------------------- %----------------------------------------------------------------------------------------
\section{Pointer} % Section title slide, unnumbered \section{Pointer} % Section title slide, unnumbered
%------------------------------------------------ %------------------------------------------------
\begin{frame}{Grundlagen} \begin{frame}{Grundlagen}
This is a simple slide. TODO
\end{frame} \end{frame}
%------------------------------------------------ %------------------------------------------------
\begin{frame}{Typesetting and Math} \begin{frame}{Pointer in C}
The packages \texttt{inputenc} and \texttt{FiraSans}\footnote{\url{https://fonts.google.com/specimen/Fira+Sans}}\textsuperscript{,}\footnote{\url{http://mozilla.github.io/Fira/}} are used to properly set the main fonts. TODO
\vfill
This theme provides styling commands to typeset \emph{emphasized}, \alert{alerted}, \textbf{bold}, \textcolor{example}{example text}, \dots
\vfill
\texttt{FiraSans} also provides support for mathematical symbols:
\begin{equation*}
e^{i\pi} + 1 = 0.
\end{equation*}
\end{frame}
%----------------------------------------------------------------------------------------
% SECTION 2
%----------------------------------------------------------------------------------------
\section{Section 2}
%------------------------------------------------
\begin{frame}{Blocks}
These blocks are part of 1 slide, to be displayed consecutively.
\begin{block}{Block}
Text.
\end{block}
\pause % Automatically creates a new "page" split between the above and above + below
\begin{alertblock}{Alert block}
Alert \alert{text}.
\end{alertblock}
\pause % Automatically creates a new "page" split between the above and above + below
\begin{exampleblock}{Example block}
Example \textcolor{example}{text}.
\end{exampleblock}
\end{frame}
%------------------------------------------------
\begin{frame}{Columns}
\begin{columns}
\column{0.5\textwidth}
This text appears in the left column and wraps neatly with a margin between columns.
\column{0.5\textwidth}
\includegraphics[width=\linewidth]{Images/placeholder.jpg}
\end{columns}
\end{frame}
%------------------------------------------------
\begin{frame}{Lists}
\begin{columns}[T, onlytextwidth] % T for top align, onlytextwidth to suppress the margin between columns
\column{0.33\textwidth}
Items:
\begin{itemize}
\item Item 1
\begin{itemize}
\item Subitem 1.1
\item Subitem 1.2
\end{itemize}
\item Item 2
\item Item 3
\end{itemize}
\column{0.33\textwidth}
Enumerations:
\begin{enumerate}
\item First
\item Second
\begin{enumerate}
\item Sub-first
\item Sub-second
\end{enumerate}
\item Third
\end{enumerate}
\column{0.33\textwidth}
Descriptions:
\begin{description}
\item[First] Yes.
\item[Second] No.
\end{description}
\end{columns}
\end{frame}
%------------------------------------------------
\begin{frame}{Table}
\begin{table}
\centering % Centre the table on the slide
\begin{tabular}{l c}
\toprule
Discipline & Avg. Salary \\
\toprule
\textbf{Engineering} & \textbf{\$66,521} \\
Computer Sciences & \$60,005\\
Mathematics and Sciences & \$61,867\\
Business & \$56,720\\
Humanities \& Social Sciences & \$56,669\\
Agriculture and Natural Resources & \$53,565\\
Communications & \$51,448\\
\midrule
\textbf{Average for All Disciplines} & \textbf{\$58,114}\\
\bottomrule
\end{tabular}
\caption{Table caption}
\end{table}
\end{frame} \end{frame}
%------------------------------------------------ %------------------------------------------------

View File

@ -5,8 +5,9 @@
\item Pointer \item Pointer
\item Arrays \item Arrays
\end{itemize} \end{itemize}
\item Befehl \textit{struct} \item Keyword \textit{struct}
\item verbessert übersicht \pause
\item verbessert Übersicht
\item Schritt richtung Objektorientierung \item Schritt richtung Objektorientierung
\item ideal für Listen und Baumstruktur \item ideal für Listen und Baumstruktur
\end{itemize} \end{itemize}