Help for Pascal Translation from C - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help for Pascal Translation from C

mcrulimcruli Posts: 2Member
Hi for all,

I need translata a funcion from C to pascal

#define TMaskClear(E, M) ((M)[(E)/8] &= ~(1 << ((E)%8)))

"E" is Integer
"M" is TMask :
Type TMask = Array[0..64] of Byte;


This part is a Matrix asignation :
(M)[(E)/8]
Okay,

Comments

  • _Atex__Atex_ Posts: 163Member
    This works with your example, not sure how will perform w/ different values though, since I didn't test it[code][color=Blue]type tmask=array[0..64] of byte;

    var m:tmask;

    procedure tmaskclear(e:integer;var n:tmask);
    begin
    n[e div 8]:=n[e div 8] and not(1 shl (e mod 8));
    end;

    begin
    fillchar(m,sizeof(m),$ff);

    tmaskclear(61,m);

    writeln(m[7]);
    readln;
    end.[/color][/code]
  • mcrulimcruli Posts: 2Member
    Works perfect,

    Thanks!!
Sign In or Register to comment.