I have a big issue because this piece of code was compiling correctly in Dev-Pascal but not in Lazarus.
for k:=1 to n do
begin
writeln(a[k]:4:2,' ',a[k+1]:4:2,' ',a[k+2]:4:2);
inc(k,2);
end;
I'm getting this message
Error: Illegal assignment to for-loop variable "k"
What I should do now? I need this solutions (incrementing k counter) in my program.
for k := 0 to n div 3 - 1 do begin writeln(a[k * 3 + 1]:4:2, ' ', a[k * 3 + 2], ...
? That is what I would do, if I had to access 3 elements on each iteration. – Roseliaroselin