תרגול #2
שיעור 7 מתוך 8 בקורס מבנים ב-C/C++ של Coddy.
אתגר
קלניתן לך קוד כלשהו. צור מבנה Contact שיתאים לשאר הקוד.
נסו בעצמכם
#include <stdio.h>
// צרו כאן את המבנה
int main() {
struct Contact contact1 = {"John Doe", "123-456-7890", "john@example.com"};
struct Contact contact2 = {"Alice Smith", "456-789-0123", "alice@example.com"};
struct Contact contact3 = {"Bob Johnson", "789-012-3456", "bob@example.com"};
printf("%s %s %s\n", contact1.name, contact1.phoneNumber, contact1.email);
printf("%s %s %s\n", contact2.name, contact2.phoneNumber, contact2.email);
printf("%s %s %s\n", contact3.name, contact3.phoneNumber, contact3.email);
return 0;
}כל השיעורים ביחידה מבנים ב-C/C++
תרגלו בעצמכם: קומפיילר C אונליין