Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

Speicherzugrifffehler FORTRAN

Empfohlene Antworten

Veröffentlicht

Hallo,

beim Kopilieren von diesem Programme bekomme ich keine Fehlermeldung, jedoch beim Öffnen einen speicherzugriffehler. Ich weiß einfach nicht, wo der Fehler liegt.

PROGRAM main

! Variablendekleration

IMPLICIT NONE

INTEGER::wahl1,i, j, wert1(9,9)

DO i=1,9

DO j=1,9

wert1(i,j)=0

ENDDO

ENDDO

PRINT*, "Herzlich Willkommen"

PRINT*, "Woraus soll die Matrix eingelesen werden?"

PRINT*, "1 - Tastatur"

PRINT*, "2 - Datei"

READ*, wahl1

DO

SELECT CASE(wahl1)

CASE(1)

CALL matrixt(wert1)

CASE DEFAULT

PRINT*, "Falsche Eingabe. Bitte erneut eingeben!"

END SELECT

IF(wahl1==1) EXIT

ENDDO

END

als externes Modul

SUBROUTINE matrixt(wert)

IMPLICIT NONE

INTEGER:: k, l, wert(9,9)

DO k=1,9

DO l=1,9

PRINT*, "Bitte geben Sie die 9 Werte der",k,".ten Zeile ein und der",l,",ten Spalte"

READ*, wert(k,l)

ENDDO

ENDDO

PRINT*,wert(k,l)

PRINT*, "Drücke ENTER"

READ*

END SUBROUTINE

Vielleicht kann mir einer weiter helfen. Das würde mich weiterbringen. Danke

Ohne Fortran zu kennen:

Ist wert1 ein Array? INTEGER::wahl1,i, j, wert1(9,9) deklariert also ein 9x9 Array. Sicher, dass in Fortran bei der "Addressierung" der Stellen im Array nicht auch bei 0 angefangen wird? Du mit

DO i=1,9

DO j=1,9

wert1(i,j)=0

also schon die Stellen 2 bis 10 ansprichst?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.