code example u. allg. struct
This commit is contained in:
parent
6ef9e1d575
commit
cd931da5ad
76
src/main.tex
76
src/main.tex
@ -2,7 +2,7 @@
|
||||
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
|
||||
%----------------------------------------------------------------------------------------
|
||||
|
||||
\documentclass{beamer}
|
||||
\documentclass[usenames,dvipsnames]{beamer}
|
||||
|
||||
\usetheme{focus} % Use the Focus theme supplied with the template
|
||||
% Add option [numbering=none] to disable the footer progress bar
|
||||
@ -14,11 +14,48 @@
|
||||
|
||||
%------------------------------------------------
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
|
||||
|
||||
\usepackage{booktabs}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{listings} % Required for better table rules
|
||||
\usepackage{xcolor}
|
||||
|
||||
% Farbdefinitionen
|
||||
\definecolor{backgroundcoloreq}{RGB}{180,140,0}
|
||||
\definecolor{codegreen}{rgb}{0,0.6,0}
|
||||
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
|
||||
\definecolor{codepurple}{rgb}{0.58,0,0.82}
|
||||
\definecolor{codeorange}{RGB}{190,100,0}
|
||||
|
||||
|
||||
\lstset{
|
||||
language=C,
|
||||
basicstyle=\ttfamily,
|
||||
numbers=left,
|
||||
numberstyle=\tiny,
|
||||
tabsize=4,
|
||||
columns=fixed,
|
||||
showstringspaces=false,
|
||||
showtabs=false,
|
||||
breaklines=true,
|
||||
keepspaces,
|
||||
morekeywords={std},
|
||||
keywordstyle=\color{blue}\ttfamily,
|
||||
stringstyle=\color{red}\ttfamily,
|
||||
commentstyle=\color{OliveGreen!85}\ttfamily,
|
||||
numberstyle=\tiny\color{codegray},
|
||||
basicstyle=\small\selectfont\ttfamily,
|
||||
% keyword highlighting
|
||||
classoffset=1, % starting new class
|
||||
otherkeywords={>,<,.,;,-,+,!,=,~,:,[,],NULL,&},
|
||||
morekeywords={>,<,.,;,-,+,!,=,~,:,[,],NULL,&},
|
||||
keywordstyle=\color{codeorange},
|
||||
classoffset=0
|
||||
}
|
||||
|
||||
%----------------------------------------------------------------------------------------
|
||||
% TITLE SLIDE
|
||||
@ -53,25 +90,34 @@
|
||||
%------------------------------------------------
|
||||
|
||||
\begin{frame}{Strukturen Allgemein}
|
||||
\begin{itemize}
|
||||
\item kategorisieren von Variablen
|
||||
\end{itemize}
|
||||
\input{structallg.tex}
|
||||
\end{frame}
|
||||
|
||||
%------------------------------------------------
|
||||
|
||||
\begin{frame}{Strukturen in C}
|
||||
\begin{lstlisting}[language=c,label={lst:lstlisting}]
|
||||
struct adresse {
|
||||
char name[50];
|
||||
char strasse[100];
|
||||
short hausnummer;
|
||||
long plz;
|
||||
char stadt[50];
|
||||
};
|
||||
\end{lstlisting}
|
||||
\begin{frame}[fragile]{Strukturen in C}
|
||||
Syntax:
|
||||
\begin{lstlisting}
|
||||
struct adresse {
|
||||
char name[50];
|
||||
char strasse[100];
|
||||
short hausnummer;
|
||||
long plz;
|
||||
char stadt[50];
|
||||
};
|
||||
\end{lstlisting}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}{Sonstiges}
|
||||
\begin{itemize}
|
||||
\item Strukturtypdeklaration: struct Adresse {…};
|
||||
\item Gesamtlänge der Struktur: sizeof(Struktur)
|
||||
\item Zugriff auf einzelne Komponenten durch\\
|
||||
Punktnotation: Adresse1.Vorname = “Peter“;
|
||||
\item Weitere Strukturen hinzufügen: struct Adresse Adresse5;
|
||||
\item Weiteres hinzufügen von Komponenten während der Laufzeit nicht möglich.
|
||||
\end{itemize}
|
||||
\end{frame}
|
||||
%------------------------------------------------
|
||||
|
||||
\begin{frame}{Strukturen als Funktionsargument}
|
||||
@ -211,7 +257,7 @@
|
||||
%------------------------------------------------
|
||||
|
||||
\begin{frame}[focus]
|
||||
Danke für eure Aufmerksamkeit!
|
||||
Danke fuerr eure Aufmerksamkeit!
|
||||
\end{frame}
|
||||
|
||||
%----------------------------------------------------------------------------------------
|
||||
|
12
src/structallg.tex
Normal file
12
src/structallg.tex
Normal file
@ -0,0 +1,12 @@
|
||||
\begin{itemize}
|
||||
\item kategorisieren von Variablen
|
||||
\begin{itemize}
|
||||
\item Variablen \textit{(int, char, double, float)}
|
||||
\item Pointer
|
||||
\item Arrays
|
||||
\end{itemize}
|
||||
\item Befehl \textit{struct}
|
||||
\item verbessert übersicht
|
||||
\item Schritt richtung Objektorientierung
|
||||
\item ideal für Listen und Baumstruktur
|
||||
\end{itemize}
|
Loading…
Reference in New Issue
Block a user