עבור לתוכן
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 פשוט זורק Segmentation Fault בלינוקס

Featured Replies

פורסם

הי. אני מריץ קוד פשוט ביותר (פחות מ-100 שורות, בלי אלמנטים מיוחדים), בשפה C במערכת UBUNTU 14.04.

הקוד בקובץ המצורף.

מצורף כאן הלוג של הטרמינל של אובונטו בהפעלת הקוד:

 

$ make clean all run
rm -f debug *.o
gcc -c main.c -Iinclude/
gcc -c global.c -Iinclude/
gcc -c specific.c -Iinclude/
gcc -o debug main.o global.o specific.o
./debug
before init
glb ptr = 0x1045010
glb default x = 0
modify in main
make: *** [run] Segmentation fault (core dumped)
 

אשמח אם מישהו יוכל לעזור. תודה מראש!

economyd.zip

פורסם

Segmentation fault בדרך כלל אומר גישה לא חוקית לזכרון. דהיינו יש לך מצביע לזכרון לא חוקי, ואתה מנסה לגשת אליו (לדוגמה אם המצביע לא מאותחל או מצביע למקום ששוחרר ע"י free).

אם לא ברור לך איפה השגיאה אז תנסה להוסיף עוד הדפסות עזר. לחילופין, תשתמש בדיבאגר (gdb) כדי לראות בדיוק איפה השגיאה.

ארכיון

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

דיונים חדשים

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.