F
filia&sofia
Hello, I have constructed a simple array (table) that has pointers as
elements. Pointers point to an integer and they are typed as "pointer
to int". When I manipulate the array, I would like to put the pointers
to point at numeric constants e.g. 43. The problem is that I can not
put a numeric constant to array (because array is typed) nor get the
pointers point to constants (like &43). Any ideas how to solve this?
Thank you.
---
int integer = 4;
int *ptr = &integer;
For example an array of size 5:
[ptr]
[ptr]
[ptr]
[ptr]
[ptr]
After manipulation it should be something like this:
[ptr]
[6] or pointer to 6
[ptr]
[N] or pointer to N, N is an integer
[ptr]
elements. Pointers point to an integer and they are typed as "pointer
to int". When I manipulate the array, I would like to put the pointers
to point at numeric constants e.g. 43. The problem is that I can not
put a numeric constant to array (because array is typed) nor get the
pointers point to constants (like &43). Any ideas how to solve this?
Thank you.
---
int integer = 4;
int *ptr = &integer;
For example an array of size 5:
[ptr]
[ptr]
[ptr]
[ptr]
[ptr]
After manipulation it should be something like this:
[ptr]
[6] or pointer to 6
[ptr]
[N] or pointer to N, N is an integer
[ptr]