newbie question

X

xPy

sorry for my english...
how can i use an array in a function and not use it by reference???
 
V

Victor Bazarov

xPy said:
sorry for my english...
how can i use an array in a function and not use it by reference???

Not sure what you mean by "use" or "use it by reference". There is no way
to pass an array into a function _by_value_. Arrays are either passed by
reference or are converted to a pointer [to the first element].

V
 
G

Greg

xPy said:
sorry for my english...
how can i use an array in a function and not use it by reference???

Use a std::vector instead. Although passing any container by value is
not very efficient (since its items must be copied) - so passing a
const reference to the container in a function call is usually a better
alternative.

Greg
 
X

xPy

sorry i the word i was looking for was "table",not "array". I want to
use it in a retroactive function, so every function will have it's own
table...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top