עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

הגדרת SET עם typedef בC

Featured Replies

פורסם

שלום רב, אני צריך לעשות את זה ומסבתך עם ההגדרה של SET, אשמח לעזרה מהירה:

עליכם לכתוב תכנית מחשב אינטראקטיבית הקוראת פקודות, מפענחת ומבצעת אותן.

הפקודות עוסקות בפעולות על קבוצות.

היא אוסף של איברים, ברי מניה, שכל איבר בו מופיע לכל היותר פעם - set - תזכורת: קבוצה

אחת.

אשר מסוגל להחזיק קבוצת set את הטיפוס typedef עליכם להגדיר, תוך השימוש בפקודת

0]. על מבנה הנתונים שבחרת להיות יעיל מבחינת כמות זיכרון, הנדרשת ... שלמים בתחום [ 127

A,B,C,D,E,F לשמירתו (רמז: עבודה עם סיביות). בנוסף עליכם להגדיר 6 משתנים חיצוניים

מטיפוס זה.

כל שם קבוצה בפקודות שלהלן יילקח מתוך השישה הנ"ל.

[attachment deleted by admin]

פורסם

א) אתה לא צריך 10 שורות של copyright בשביל תרגיל בית בקורס C בסיסי.

ב) מה בדיוק הבעיה? אתה לא מבין איך לעשות את זה?

פורסם
  • מחבר

מסתבך בלהגדיר את זה ולגשת אחר כך

שינתי לבא ואז מסתבך לגשת לזה:

/#ifndef SET_H_

#define SET_H_

#endif /* SET_H_ */

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <ctype.h>

#include <math.h>

#define END_SET -1

#define SIZE 8

typedef unsigned char set[16];

set A,B,C,D,E,F;

struct{

char names;

set *name;

}sets[]={

{'a',&A},

{'b',&B},

{'c',&C},

{'d',&D},

{'e',&E},

{'f',&F},

{'A',&A},

{'B',&B},

{'C',&C},

{'D',&D},

{'E',&E},

{'F',&F},

{'#',NULL}

};

int read_set(void);

int print_set(void);

int intersect_set(void);

int sub_set(void);

int union_set(void);

int help(void);

int halt(void);

נ.ב השורות בהתחלה זה בקובץ והדרישה בהגשת ממן :)

פורסם

שים את הקוד שלך בתג code (הכפתור שנראה כמו סולמית).

אם הבנתי נכון, יש לך typedef אבל אתה לא יודע איך להשתמש בו?


#define SET_SIZE 16
typedef unsigned char Set[SET_SIZE];

void AddToSet(Set s, int member)
{
if ( s == NULL ) return;
...
s[index] |= 1 << bit;
...
}

int main()
{
Set s;
...
AddToSet(s, 30);
...
}

פורסם

מה זה "מסתבך לגשת"?

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.