Menu
Coddy logo textTech

The Class

Lektion 1 von 8 im Kurs User-Klasse - OOP-Projekt von Coddy.

challenge icon

Aufgabe

Einfach

Erstellen Sie eine Klasse namens User, die vorerst keinen Inhalt hat.

Probier es selbst

#include <stdio.h>
#include <string.h>
#include "user.h"

int main() {
    char line[1024];
    while (fgets(line, sizeof(line), stdin)) {
        line[strcspn(line, "\r\n")] = '\0';
        if (line[0] == '\0') continue;
        if (strcmp(line, "exists") == 0) {
            User u;
            User_init(&u);
            printf("yes\n");
        }
    }
    return 0;
}

Alle Lektionen in User-Klasse - OOP-Projekt