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

c# | העברת משתנים ספציפים לפונקציה

Featured Replies

פורסם

היי, אני עושה מעבר לC# מפייתון ורציתי לשאול - יש מצב שאי אפשר ב-C# לקרוא לפונקציה רק עם חלק מהמשתנים?

בפייתון אני יכול לעשות משהו כזה:

func: def example(param1="1", param2="2"):

call: example(param2="not 2")

בC# זה לא עובד:

func: public void example(string param1="1", string param2="2"){}

call: example(param2="not 2")

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

נערך על-ידי TheAnthrax

פורסם

ברוך הבא לפורום. ערוך בבקשה את הכותרת כך שתכיל את השפה שבה אתה כותב.

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

פורסם
  • מחבר

היי,

ראיתי אחרי ששלחתי שאתם כותבים בדר"כ שפה, אבל לא הצלחתי לערוך את הכותרת.. מצטער על זה.

בכל אופן - תודה על התשובה הזריזה!

פורסם

בשביל לערוך את הכותרת, צריך ללחוץ על כפתור "עריכה" בהודעה הראשונה, ואז על "מצב מתקדם".

ארכיון

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

דיונים חדשים

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.