0

May seem like a stupid question but can an array call a function? and if so is it possible to select an array from user input, so if the array was something like Num[10] and the user would input 6, it would then select Num[5] and call the function associated with that subscript.

3
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by gerard4143
0

No. An array is a list of values. Values can't call functions. Only code can call functions.

0

So I guess it was a stupid a question, thanks anyway.

0

Technically speaking, the only difference between code and data are memory attributes. So an array could carry values that equate to a function calls but you could not call them unless you changed the memory attributes to read/execute and pointed the instruction pointer at them..

0

Technically speaking, the only difference between code and data are memory attributes. So an array could carry values that equate to a function calls but you could not call them unless you changed the memory attributes to read/execute and pointed the instruction pointer at them..

:icon_rolleyes:

Edited by WaltP: Added rest of quote for clarity.

0

:icon_rolleyes:

So your stating that memory attributes can't be changed? Are you sure about your 'rolling eyes' and what it implies.

0

I know what I meant to imply, and it has nothing to do with memory attributes. I see I should have quoted the entire statement. So corrected.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.