← Back to topics
Topic

int64 problem

N
Nikola94
why is this compilation error ?


var
n, i : in64;
begin
readln(n);
for i := 1 to n do
...
end.


why do "for loop variables" can't be int64 ?
p
picsel
Because thats how the compiler works :P
Use a while loop if you need one with int64
m
matteo123

var
n, i : int64;
begin
readln(n);
for i := 1 to n do
...
that's the right code .look at your n, i : int64;
end.
N
Nikola94
i know i wrote in64 by accident, but that's not the topic :)
n
nemanja1990
you cant use int64 in for loop

that is how pascal works

you can use while and repeat instead or use for with longint