C++ SS22: Vorlesung Stand 03.04., Proto-Übungszettel 4

This commit is contained in:
2022-04-03 23:52:10 +02:00
parent 2f97b8ef91
commit f5ecb8a8de
4 changed files with 560 additions and 5 deletions
+8 -5
View File
@@ -9,7 +9,9 @@
\usepackage{tcolorbox}
\tcbuselibrary{minted}
\tcbuselibrary{xparse}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\definecolor{codebg}{rgb}{.85,.85,.85}
\newminted{cpp}{autogobble,linenos,mathescape,bgcolor=codebg}
@@ -111,7 +113,7 @@
%\hfill\\
%{\bf \large }\\
\hfill\\
{\bf \large Sommer 2022 \hfill Übung 1}\\
{\bf \large Sommer 2022 \hfill Übung 3}\\
\end{center}
\noindent
\begin{tabular}{p{16.6cm}}
@@ -135,7 +137,7 @@ Linus Benedict Torvalds ist ein finnisch-US-amerikanischer Informatiker und Sof
\\
\hfill\\
\end{center}
\vspace*{-0.3cm} {\large\it Linus Torvals.}
\vspace*{-0.3cm} {\large\it Linus Torvalds.}
\end{wrapfigure}
\\
\\
@@ -263,7 +265,7 @@ pd = *pi; //(h)
pi = 0; //(j)
\end{cpp}
\part Was passiert in folgendem Programm und wieso ist es falsch?
\begin{cpp}
\begin{cpp}[fontsize=\footnotesize]
#include <iostream>
#include <string>
@@ -279,11 +281,12 @@ int main(int argc, char** argv)
{
*i *=j;
}
cout <<*i <<endl;
std::cout <<*i <<endl;
}
return 0;
}
\end{cpp}
Lassen Sie das Programm laufen und warten ein wenig. Schauen Sie am besten mit dem Befehl \bashinline{htop} auf den Speicherverbrauch Ihres Programms.
\end{parts}
\end{document}