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

הגדרת typedef למערך/מטריצה ב C

Featured Replies

פורסם

היי,

אני מנסה להגדיר טיפוס למערך/מטריצה.

בקובץ H כתבתי:

typedef int mytype[2][2]

בקובץ התכנית אני מגדירה את המשתנה באופן הבא:

mytype A[2][2]={{1,2},{1,2}}

וכשאני מדפיסה:


for(j=0;j<2;j++)
printf("%d ", A[i][j]);
for(i=0;i<2;i++){    

התוכנית מדפיסה לי כתובות/זבל...

מה לא בסדר?

מה פספסתי? :smiley7:

נערך על-ידי unknown20070

פורסם

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

לשאלתך:

הגדרת את mytype בתור מערך דו מימדי. לאחר מכן הגדרת את A בתור מערך דו מימדי של mytype. זה אומר ש-A הוא מערך דו מימדי של מערכים דו מימדיים.

פורסם
  • מחבר

נערך.. :)

תודה!!

ארכיון

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

דיונים חדשים

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.