index — ti25-glauchau-code @ f77c8a36ac9507fced2ca2130fdd1bd5b5f8b1db

Meine Lösungen (oder auch nicht) für die Programmieraufgaben in der TI25 an der Staatlichen Studienakademie Glauchau

gpt/2025-12-09: structs
crispy-caesus crispy@crispy-caesus.eu
Tue, 09 Dec 2025 15:16:29 +0100
commit

f77c8a36ac9507fced2ca2130fdd1bd5b5f8b1db

parent

72a1f44f3f7b9f35f97b3dcb692ffd7cc4fc06dd

1 files changed, 23 insertions(+), 0 deletions(-)

jump to
A gpt/2025-12-09/structtest.c

@@ -0,0 +1,23 @@

+#include <stdio.h> +#include <stdlib.h> + +typedef struct point3D { + char name; + float x; + float y; + float z; +} p3d; + +int main(){ + p3d *p; + p = (p3d*) malloc(sizeof(p3d)); + + printf("name, x, y, z:\n"); + scanf("%c", &p->name); + scanf("%f", &p->x); + scanf("%f", &p->y); + scanf("%f", &p->z); + printf("Koordinaten von %c: (%f, %f, %f)", p->name,p->x,p->y,p->z); + + return 0; +}