calloc


memory reservation

calloc
format
See also

calloc

p=calloc(n)

        Returns p size n initialized to 0.

p=calloc(dim,v)

        Returns p size n initialized to v.
Options:
p=calloc(n,v1,v2): Returns p size n initialized between v1 and v2.
cos(omega,phi): p[i]=cos(omega*i+phi)
rand(r): p[i]=rand(r)
rand2(r1,r2): p[i]= rand2(r1,r2)
randf(r): p[i]=randf(r)
rand2f(r1,r2): p[i]=rand2f(r1,r2)
sin(omega,phi): p[i]=sin(omega*i+phi)
tan(omega,phi): p[i]=tan(omega*i+phi)
Notes:
1) calloc is used to declare and initialize large arrays:
w=[1,1000000] overflows.
w=calloc(1000000) sets 1000000 zero floats.
2) To release a buffer initialized by buf=calloc(1000000) write: buf=NIL.
Examples:
w=calloc(100000); w is a variable of 100000 floating zero.
w=calloc(100000,-1): w is a variable de 100000 floating -1.0.

calloc format

p=calloc format(x,y,x2,y2,v1,v2)

        Returns p size x*y initialized with a regular checkboard (x columns y lines) values v1 and v2 (0,1 default).

p=calloc format(x,y,x2,y2,v1,v2,n)

        Returns p size x*y initialized with a regular checkboard (x columns y lines) values v1, with n boxes size (x2,y2) values v2.

See also:

malloc