BYREF arrays
Posted: Wed Feb 13, 2013 1:31 pm
Hi Bruce,
Does the compiler support passing a pointer to an integer array?
such as:
#define ARRAYSIZE 10
dim array(ARRAYSIZE) as integer
FUNCTION findSum(BYREF array)
dim sum as integer
dim i as integer
for i=0 to ARRAYSIZE
sum = sum + array(i)
next
return (sum)
END FUNCTION
main:
dim i as integer
for i=0 to ARRAYSIZE
array(i) = i
next i
print findSum(array)
end
Does the compiler support passing a pointer to an integer array?
such as:
#define ARRAYSIZE 10
dim array(ARRAYSIZE) as integer
FUNCTION findSum(BYREF array)
dim sum as integer
dim i as integer
for i=0 to ARRAYSIZE
sum = sum + array(i)
next
return (sum)
END FUNCTION
main:
dim i as integer
for i=0 to ARRAYSIZE
array(i) = i
next i
print findSum(array)
end