Zum Inhalt springen

Benutzer:Dirk Huenniger/temfortran

Aus Wikibooks
0   . |  1    .    2    .    3    .    4    .    5    .    6    .    7 |  .    8  
12345678901234567890123456789012345678901234567890123456789012345678901234567890
      PROGRAM HALLO 
C                        
C     Das typische Hallo Welt-Programm
C                 
      WRITE (*,*) 'Hallo Welt!'
      END            
12345678901234567890123456789012345678901234567890123456789012345678901234567890
0   . |  1    .    2    .    3    .    4    .    5    .    6    .    7 |  .    8  
Fortran 90/95-Code (free source form)
program hallo 
  ! Das typische "Hallo Welt"-Programm
  write( *, * ) 'Hallo Welt!'
end program hallo


Programmcode
#include <stdio.h>
 
void zahl(int a, int *b)
{
  printf("%s%d\n", "Ergebnis = ", a * *b);
}


Fortran 2003 (oder neuer)-Code
program bsp
  implicit none 

  interface
    function addition( a, b ) bind( c[, name="c_func"] )
      use, intrinsic :: iso_c_binding
      real( kind = c_float ), value :: a
      real( kind = c_float ), value :: b
      real( kind = c_float )        :: addition
    end function addition
  end interface

  write (*,*) addition( 2.5, 3.3 )

! Ausgabe:  5.8  
end program bsp

l = c_associated ( c_ptr1 [, c_ptr2] )

get_command (  [c, i, i] )

<<< zur Fortran-Startseite
<< Fortran 2003 Bibliotheken >>
< Ein- und Ausgabe Intrinsische Module >
<< zur Fortran-Startseite
< Fortran 2003 DISLIN >


Wikipedia hat einen Artikel zum Thema:


Beispiel funktioniert mit Compiler

  • g95 (0.91!) May 10 2007: ja
  • gfortran 4.3.0 20070723 (experimental): ja
  • Intel Fortran Compiler 10.0: ja
  • Sun Studio Express - June 2007: ja

Anmerkungen:

A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z