330 Introduction to C++ Programming and Graphics
Fortran 77 C++
cAUTHOR:JDoe /* AUTHOR: J Doe */
program main int main()
... {
stop ...
end return 0;
}
Dimension a(0:29), b(0:3) float a[30], b[4];
Double precision a(0:9) double a[10];
Double precision b(0:5,0:67) double b[6][68];
Integer argos(100) int argos[100];
Dimension argos(-23:89)
Integer WED const int WED= 0;
Parameter(WED=134)
Double precision a(0:39) const int dim = 40;
double a[dim];
i = 6! integer inti=6;//integer
a = 10.0! real float a = 10.0; // real
b = 10.0D0! double double b = 10.0; // double
Dimension b(0:1) float b[2] ={0.1, 0.3};
b(0) = 0.1
b(1) = 0.3
Dimension A(0:1,0:1) float A[2][2] ={{0.1, 0.2},{-1.0, -0.4}};
A(0,0) = 0.1
A(0,1) = 0.2
A(1,0) =-1.0
A(1,1) = 0.4
Stop exit(1);
Go to 34 goto melitzana;
34 Continue melitzana:
Table C.3 Fortran 77/C++ equivalent structures and statements.