\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{feststelltast3} \pdfinfo{ /Title (c-deutsch.pdf) /Creator (Cheatography) /Author (feststelltast3) /Subject (C - Deutsch Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{14A35B} \definecolor{LightBackground}{HTML}{F0F9F4} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{C - Deutsch Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{feststelltast3} via \textcolor{DarkBackground}{\uline{cheatography.com/42140/cs/12707/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}feststelltast3 \\ \uline{cheatography.com/feststelltast3} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 5th September, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{2.356 cm} x{2.66 cm} x{2.584 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Basisdatentypen}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Typ}} & {\bf{Wertebereich (min.)}} & {\bf{Formatzeichen}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{Ganzzahlen}}} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `signed char` & -128 \{\{nl\}\}+128 & `\%hhd` (für Dezimal) und `\%c` (für Zeichen) \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} `short` & -32768 \{\{nl\}\}+32767 & `\%hd` oder `\%hi` \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} `int` & -32768 \{\{nl\}\}+32767 & `\%d` oder `\%i` \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} `long` & \seqsplit{-2.147.483.648} \{\{nl\}\}+2.147.483.647 & `\%d` oder `\%li` \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} `long long` & \seqsplit{-9.223.372.036.854.775.808} \{\{nl\}\}+9.223.372.036.854.775.807 & `\%lld` oder `\%lli` \tn % Row Count 19 (+ 5) % Row 7 \SetRowColor{white} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{Vorzeichenlose Ganzzahlen}}} \tn % Row Count 20 (+ 1) % Row 8 \SetRowColor{LightBackground} `\_Bool` & 0 und 1 & `\%u` \tn % Row Count 21 (+ 1) % Row 9 \SetRowColor{white} `unsigned char` & 0 bis 255 & `\%hhu` (für Dezimal) \{\{nl\}\}`\%c` (für Zeichen) \tn % Row Count 25 (+ 4) % Row 10 \SetRowColor{LightBackground} `unsigned short` & 0 bis 65.535 & `\%hu` \tn % Row Count 27 (+ 2) % Row 11 \SetRowColor{white} `unsigened int` & 0 bis 65.535 & `\%u` \tn % Row Count 29 (+ 2) % Row 12 \SetRowColor{LightBackground} `unsigned long` & 0 bis 4.294.967.295 & `\%lu` \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{2.356 cm} x{2.66 cm} x{2.584 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Basisdatentypen (cont)}} \tn % Row 13 \SetRowColor{LightBackground} `unsigned long long` & 0 bis \seqsplit{18.446.744.073.709.551.615} & `\%llu` \tn % Row Count 3 (+ 3) % Row 14 \SetRowColor{white} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{Flie{\ss}kommazahlen}}} \tn % Row Count 4 (+ 1) % Row 15 \SetRowColor{LightBackground} `float` & 1.2E-38\{\{nl\}\}3.4E+38 & `\%f` \tn % Row Count 6 (+ 2) % Row 16 \SetRowColor{white} `double` & 2.3E-308\{\{nl\}\}1.7E+308 & `\%f`\{\{nl\}\}(`\%lf` für scanf) \tn % Row Count 9 (+ 3) % Row 17 \SetRowColor{LightBackground} `long double` & 3.4-4932\{\{nl\}\}1.1E+4932 & `\%Lf` \tn % Row Count 11 (+ 2) % Row 18 \SetRowColor{white} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}In der Praxis empfiehlt es sich, immer den Flie{\ss}kommatyp `double` zu verwenden, weil der Compiler den Typ `float` intern h{\"a}ufig ohnehin in den Typ `double` umwandelt.} \tn % Row Count 15 (+ 4) % Row 19 \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{Speicherbedarf mit sizeof ermitteln}}} \tn % Row Count 16 (+ 1) % Row 20 \SetRowColor{white} `int ival = 0;`\{\{nl\}\}`sizeof(ival);` & Gibt Gr{\"o}{\ss}e des Operanden in Byte(s) zurück. & \tn % Row Count 20 (+ 4) % Row 21 \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{Konstanten}}} \tn % Row Count 21 (+ 1) % Row 22 \SetRowColor{white} `const typ`; & Markiert die Variable als {\emph{read-only}} (kann nicht mehr zur Laufzeit ver{\"a}ndert werden). & \tn % Row Count 28 (+ 7) % Row 23 \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{\{\{bt\}\}{\bf{void}}} \tn % Row Count 29 (+ 1) % Row 24 \SetRowColor{white} `void` & leerer Datentyp & \tn % Row Count 31 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.64 cm} x{5.36 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Rechnen mit C und Operatoren}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}Ein- und Ausgabe ben{\"o}tigt den Header `\textless{}stdio.h\textgreater{}`} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}Mathematische Funktionen ben{\"o}tigen den Header `\textless{}math.h\textgreater{}`} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{Werte formatiert einlesen mit scanf}}} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} `scanf("\%d",\&ivar);` & Formatiertes Einlesen von der Standardeingabe. \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Arithmetische Operatoren}}} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} {\bf{Operator}} & {\bf{Bedeutung}} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} `+=` & `Val1 += Val2` ist gleichwertig mit `Val1 = Val11 + Val2` \tn % Row Count 12 (+ 3) % Row 7 \SetRowColor{white} `-=` & `Val1 -= Val2` ist gleichwertig mit `Val1 = Val11 - Val2` \tn % Row Count 15 (+ 3) % Row 8 \SetRowColor{LightBackground} `*=` & `Val1 {\emph{= Val2` ist gleichwertig mit `Val1 = Val11 }} Val2` \tn % Row Count 18 (+ 3) % Row 9 \SetRowColor{white} `/=` & `Val1 /= Val2` ist gleichwertig mit `Val1 = Val11 / Val2` \tn % Row Count 21 (+ 3) % Row 10 \SetRowColor{LightBackground} `\%=` & `Val1 \%= Val2` ist gleichwertig mit `Val1 = Val11 \% Val2` \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Inkrement- und Dekrement-Operator}}} \tn % Row Count 25 (+ 1) % Row 12 \SetRowColor{LightBackground} `++` & Inkrement-Operator (Variable wird um 1 erh{\"o}ht) \tn % Row Count 27 (+ 2) % Row 13 \SetRowColor{white} `-{}-` & Dekrement-Operator (Variable wird um 1 verringert) \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} {\emph{Anwendung}} & {\emph{Bedeutung}} \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{2.64 cm} x{5.36 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Rechnen mit C und Operatoren (cont)}} \tn % Row 15 \SetRowColor{LightBackground} `var++` & Erh{\"o}ht den aktuellen Wert von `var`, gibt aber noch den {\emph{alten}} Wert an den aktuellen Ausdruck weiter. \tn % Row Count 4 (+ 4) % Row 16 \SetRowColor{white} `++var` & Erh{\"o}ht den aktuellen Wert von `var` und gibt diesen sofort an den aktuellen Ausdruck weiter. \tn % Row Count 8 (+ 4) % Row 17 \SetRowColor{LightBackground} `var-{}-` & Reduziert den Wert von `var`, gibt aber noch den alten Wert van den aktuellen Ausdruck weiter. \tn % Row Count 12 (+ 4) % Row 18 \SetRowColor{white} `-{}-var` & Reduziert den Wert von `var` und gibt diesen sofort an den aktuellen Ausdruck weiter. \tn % Row Count 16 (+ 4) % Row 19 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Bit-Operatoren}}} \tn % Row Count 17 (+ 1) % Row 20 \SetRowColor{white} {\emph{Bit-Operator}} & {\emph{Bedeutung}} \tn % Row Count 19 (+ 2) % Row 21 \SetRowColor{LightBackground} `\&` & bitweise UND-Verknüpfung (and) \tn % Row Count 21 (+ 2) % Row 22 \SetRowColor{white} `|` & bitweise ODER-Verknüpfung (or) \tn % Row Count 23 (+ 2) % Row 23 \SetRowColor{LightBackground} `\textasciicircum{}` & bitweises XOR \tn % Row Count 24 (+ 1) % Row 24 \SetRowColor{white} `\textasciitilde{}` & bitweise Komplement \tn % Row Count 25 (+ 1) % Row 25 \SetRowColor{LightBackground} `\textgreater{}\textgreater{}` & Rechtsverschiebung \tn % Row Count 26 (+ 1) % Row 26 \SetRowColor{white} `\textless{}\textless{}` & Linksverschiebung \tn % Row Count 27 (+ 1) % Row 27 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}Die Operanden für die Verwendung mit Bit-Operatoren müssen immer ganzzahlige Datentypen sein. `float` oder `double` dürfen nicht als Operanden verwendet werden.} \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{2.64 cm} x{5.36 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Rechnen mit C und Operatoren (cont)}} \tn % Row 28 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Vergleichs-Operatoren}}} \tn % Row Count 1 (+ 1) % Row 29 \SetRowColor{white} `a \textless{} b` & Kleiner als. Wahr, wenn `a` kleiner `b`. \tn % Row Count 3 (+ 2) % Row 30 \SetRowColor{LightBackground} `a \textless{}= b` & Kleiner oder gleich. Wahr, wenn `a` kleiner oder gleich gro{\ss} wie `b`. \tn % Row Count 6 (+ 3) % Row 31 \SetRowColor{white} `a \textgreater{} b` & Gr{\"o}{\ss}er als. Wahr, wenn `a` gr{\"o}{\ss}er `b`. \tn % Row Count 8 (+ 2) % Row 32 \SetRowColor{LightBackground} `a \textgreater{}= b` & Gr{\"o}{\ss}er oder gleich. Wahr, wenn `a` gr{\"o}{\ss}er oder gleich gro{\ss} wie `b`. \tn % Row Count 11 (+ 3) % Row 33 \SetRowColor{white} `a == b` & Gleich. Wahr, wenn `a` gleich `b`. \tn % Row Count 13 (+ 2) % Row 34 \SetRowColor{LightBackground} `a != b` & Ungleich. Wahr wenn `a` ungleich `b`. \tn % Row Count 15 (+ 2) % Row 35 \SetRowColor{white} `a \&\& b` & Logisches UND. Wahr, wenn `a` und `b` nicht 0 sind. \tn % Row Count 17 (+ 2) % Row 36 \SetRowColor{LightBackground} `a || b` & Logisches ODER. Wahr, wenn entweder `a` oder `b` nicht 0 sind. \tn % Row Count 20 (+ 3) % Row 37 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{bt\}\}{\bf{Implizite Typumwandlung}}} \tn % Row Count 21 (+ 1) % Row 38 \SetRowColor{LightBackground} `(typ)a` & Gibt `a` als entsprechenden `typ` zurück. \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Bedinge Anweisung und Verzweigung}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{if, else if, else}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `if (a) \{\{\{nl\}\}~~b;\{\{nl\}\}\}` & Führt `b` aus, wenn `a` wahr ist. \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `if (a) \{ \{\{nl\}\}~~b;\{\{nl\}\}~~c;\{\{nl\}\} \}` & Führt `b` und `c` aus, wenn `a` wahr ist. \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} `if (a) \{\{\{nl\}\}~~b;\{\{nl\}\}\} \{\{nl\}\}else \{\{\{nl\}\}~~c;\{\{nl\}\}\}` & Führt `b` aus, wenn `a` wahr ist. \{\{nl\}\}Ansonsten wird `c` ausgeführt. \tn % Row Count 10 (+ 4) % Row 4 \SetRowColor{LightBackground} `if (a) \{\{\{nl\}\}~~b;\{\{nl\}\}\}\{\{nl\}\}else if (c) \{\{\{nl\}\}~~d;\{\{nl\}\}\}\{\{nl\}\}else \{\{\{nl\}\}~~e;\{\{nl\}\}\}` & Führt `b` aus, wenn `a` wahr ist, \{\{nl\}\}ansonsten `d`, wenn `c` wahr ist.\{\{nl\}\}Sollte beides unwahr sein, wird `e` ausgeführt. \tn % Row Count 17 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}