Re: Variable length arrays
On Thu, 06 Mar 2008 20:02:22 +0100, jacob navia wrote:
If you replace
int tab[size];
with
int tab[size*i+1];
gcc will ALSO produce different arrays for each iteration.
If you print a pointer to the end of the array, you'll find it has the
same address every time. It happens to be a system with a stack that grows
downwards, so it's not practical to give the start of the array a fixed
location, but there's no reason why the end should not be given one.
.
Relevant Pages
- Re: Memory Leak Problem
... And each iteration I generated about 700000 random numbers. ... The variable that contains these random numbers is a pointer, ... compiler which does not allow REAL valued array indexes. ... to use rout, which has a pointer attribute, as an argument and then ... (comp.lang.fortran) - Re: char **argv & char *argv[]
... "pointer to pointer to char". ... >> pointer)) pointing to the first element of an array. ... so we have to start adding more context. ... type "pointer to char", rather than "array MISSING_SIZE of char". ... (comp.lang.c) - Re: why cannot assign to function call
... hypothetical C-like languages, ... sizeof business would still indicate that a pointer was being passed. ... talk about variables of an array type. ... the earlier version of the standard didn't have numbered ... (comp.lang.python) - Re: multi dimensional arrays as one dimension array
... please - where does the standard say that such a conversion ... Pointer conversion yields a pointer to the same object as ... exist only where there are array declarations. ... (comp.lang.c) - Re: Evaluating unary *
... 'arr' exists, ... value can be used with the same syntax as would be used to access a 2D array of the kind you're referring to, but that 2D array is just a different way of looking as the same object that was already created by the definition of 'arr'. ... to me, it makes sense to return a pointer to the first value of an array, but to return the address of the pointer to the first value of an array, is not directly possible as such. ... lea eax, ... (comp.std.c) |
|