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

בעיית include ב-c++

Featured Replies

פורסם

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

המחלקות הן סינגלטון ולכן בכל אחת אני רוצה להחזיק פוינטר לשנייה.

הבעייה היא שהגדרת פוינטר כמשתנה מחלקה בכל אחת מהן נכשל - ודי ברור למה - הפרהפרוססור

פועל על אחת מהן לפני השנייה ולכן שהשנייה עדיין לא מכירה את הראשונה.

איך אני פותר את הבעייה ?

פורסם

אתה מצהיר על המחלקה לפני המחלקה שאתה רוצה להשתמש בה.

משהו כזה:



class A;

class B
{
A* pA;
}




class B;

class A
{
B* pB;
}


פורסם

בקובץ ה-h של כל מחלקה, תוסיף הצהרה על המחלקה האחרת. כלומר, נניח שלשתי המחלקות שלך קוראים A ו-B, אז תגדיר ככה:

ב-A.h:

class B;

class A
{
// Definition of A here

}

וב-B.h:

class A;

class B
{
// Definition of B here

}

עריכה: Ah! Ninja'd!

פורסם

למה נינגה?

פורסם
  • מחבר

וואלה עובד, מגניב

תודה אנשים :yelclap:

פורסם

האתר מת...

פורסם

הוא נוטה ליפול עקב עומס בשבועות האחרונים.

נסה שוב (אם זה מספיק חשוב לך...)

פורסם

טוב נו.. נכניס מילה חדשה למילון.

ארכיון

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

דיונים חדשים

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.