Is this a bug ?
Binarydepth
binarydepth at gmail.com
Thu Nov 28 16:35:27 PST 2013
Here is my code : It compiles but in run time terminal shows a
segmentation fault. Am I doing something wrong ? Or do I have to
file a Bug ?
--------------------------------------------------------------------
import std.stdio : write, readf;
void funcion(int a, int t)
{
int temp, bd, an;
temp=t;
temp*=20;
temp+=402;
temp*=5;
temp+=3;
bd=temp-a;
temp=t;
temp*=5;
temp+=50;
temp*=20;
temp+=1013;
an=temp-a;
write(" %d: %d\n", bd, an);
}
void main()
{
int r, f, count, b;
write("Input your birth year : ");
readf(" %d", &b);
write("Input the range for the calculations (# #) : ");
readf(" %d %d", &r, &f);
for(count=r; count<=f; count++)
{
funcion(b, count);
}
}
---------------------------------------------------------------------------------
More information about the Digitalmars-d
mailing list