עבור לתוכן
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.

בעייה ברשימה מקושרת בשפה סי.

Featured Replies

פורסם

שלום לכולם!

אני מנסה לעביר מטריצה לתוך רשימה מקושרת

הנה הקוד:




typedef struct mode
{
char brd[3][3];
int scor;
struct Modes *next;
}Modes;


Modes *add(Modes *head,char bord[3][3],int point)
{
Modes *new_mode;
new_mode = (Modes*) malloc(sizeof(Modes));
new_mode->brd = bord;
new_mode->scor = point;
new_mode->next = head;
return new_mode;
}

וכשאני מנסה להריץ את התוכנית אני מקבל הודעת שגיאה :

error C2106: '=' : left operand must be l-value

יש למישהוא מושג ?

תודה רבה מראש :-)

פורסם
  • מחבר

אז איך אני מעביר מערך דו מימדי לתוך רשימה מקושרת?

פורסם

זה לא קשור לעובדה שזו רשימה מקושרת.

בשביל להעתיק תוכן של מערך אחד לאחר, אתה יכול להשתמש בלולאה ולהעתיק איבר איבר, או להשתמש ב-memcpy.

במקרה שלך, זה יהיה ככה:

memcpy(new_mode->brd, bord, sizeof(bord));

פורסם
  • מחבר

תודה רבה רבה !

עובד! :-)

ארכיון

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

דיונים חדשים

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.