C.tex 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. \chapter{C}
  2. \index{C|(}
  3. C ist eine imperative Programmiersprache.
  4. \section{Datentypen}\xindex{Datentypen}
  5. Die grundlegenden C-Datentypen sind
  6. \begin{table}[htp]
  7. \centering
  8. \begin{tabular}{|l|l|}
  9. \hline
  10. \textbf{Typ} & \textbf{Größe} \\ \hline\hline
  11. char & 1 Byte \\ \hline
  12. int & 4 Bytes \\ \hline
  13. float & 4 Bytes \\ \hline
  14. double & 8 Bytes \\ \hline
  15. void & 0 Bytes \\ \hline
  16. \end{tabular}
  17. \end{table}
  18. zusätzlich kann man \texttt{char}\xindex{char} und \texttt{int}\xindex{int}
  19. noch in \texttt{signed}\xindex{signed} und \texttt{unsigned}\xindex{unsigned}
  20. unterscheiden.
  21. \section{ASCII-Tabelle}
  22. \begin{table}[htp]
  23. \centering
  24. \begin{tabular}{|l|l||l|l||l|l||l|l|}
  25. \hline
  26. \textbf{Dez.} & \textbf{Zeichen} & \textbf{Dez.} & \textbf{Zeichen} & \textbf{Dez.} & \textbf{Zeichen} & \textbf{Dez.} & \textbf{Zeichen} \\ \hline\hline
  27. 0 & ~ & 31 & ~ & 64 & @ & 96 & ' \\ \hline
  28. 1 & ~ & ~ & ~ & 65 & A & 97 & a \\ \hline
  29. 2 & ~ & ~ & ~ & 66 & B & 98 & b \\ \hline
  30. 3 & ~ & ~ & ~ & ~ & C & 99 & c \\ \hline
  31. 4 & ~ & ~ & ~ & ~ & D & 100 & d \\ \hline
  32. 5 & ~ & ~ & ~ & ~ & E & ~ & ~ \\ \hline
  33. 6 & ~ & ~ & ~ & ~ & F & ~ & ~ \\ \hline
  34. 7 & ~ & ~ & ~ & ~ & G & ~ & ~ \\ \hline
  35. 8 & ~ & ~ & ~ & ~ & H & ~ & ~ \\ \hline
  36. 9 & ~ & ~ & ~ & ~ & I & ~ & ~ \\ \hline
  37. 10 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  38. 11 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  39. 12 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  40. 13 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  41. 14 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  42. 15 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  43. 16 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  44. 17 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  45. 18 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  46. 19 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  47. 20 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  48. 21 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  49. 22 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  50. 23 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  51. 24 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  52. 25 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  53. 26 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  54. 27 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  55. 28 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  56. 29 & ~ & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline
  57. 31 & ~ & ~ & ~ & ~ & ~ & 127 & ~ \\ \hline\hline
  58. \end{tabular}
  59. \end{table}
  60. \section{Syntax}
  61. \section{Beispiele}
  62. \subsection{Hello World}
  63. Speichere den folgenden Text als \texttt{hello-world.c}:
  64. \inputminted[linenos, numbersep=5pt, tabsize=4, frame=lines, label=hello-world.c]{c}{scripts/c/hello-world.c}
  65. Compiliere ihn mit \texttt{gcc hello-world.c}. Es wird eine ausführbare
  66. Datei namens \texttt{a.out} erzeugt.
  67. \index{C|)}