This commit is contained in:
Bora Zuenbuelkoek 2025-05-09 08:56:54 +02:00
parent fa1fd42f64
commit 28ff2d1464
5 changed files with 33 additions and 8 deletions

BIN
a.exe

Binary file not shown.

11
adturing.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef ADTURING_H
#define ADTURING_H
// Addiert 1 zu einer Dualzahl (als String) und speichert das Ergebnis in output
// input: Dualzahl als String, z.B. "1011"
// output: Ergebnis als String, z.B. "1100"
// maxlen: Maximale Länge des output-Arrays (inklusive '\0')
void dual_addiere_eins(const char *input, char *output, int maxlen);
#endif // ADTURING_H

11
bildschi.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef BILDSCHI_H
#define BILDSCHI_H
// Liest eine Dualzahl als Zeichenkette vom Benutzer ein
void dualzahl_einlesen(char *buffer, int maxlen);
// Gibt die Dualzahl aus
void dualzahl_ausgeben(const char *buffer);
#endif // BILDSCHI_H

View File

@ -1,11 +1,6 @@
#include <stdio.h>
#include <string.h>
// Funktionsprototypen (damit der Compiler weiß, dass es sie gibt)
void fehlerausgabe(const char *msg);
void dualzahl_einlesen(char *buffer, int maxlen);
void dualzahl_ausgeben(const char *buffer);
void dual_addiere_eins(const char *input, char *output, int maxlen);
#include "fehler.h"
#include "bildschi.h"
#include "adturing.h"
#define MAXLEN 65 // Maximale Länge der Dualzahl (64 Bit + 1 für \0)

8
fehler.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef FEHLER_H
#define FEHLER_H
// Gibt eine Fehlermeldung aus und beendet das Programm
void fehlerausgabe(const char *msg);
#endif // FEHLER_H