The Class
Coddyの「Userクラス - OOPプロジェクト」コースのレッスン 1/8。
チャレンジ
簡単今のところは中身が空の、User という名前のクラスを作成してください。
自分で試してみよう
#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;
}