Questions about Arrays?

Hey I'm learning about arrays and I have some questions about them.

I was wondering if arrays can be returned from a function?

Updated:
Which function can pass to an array? Is it by value, reference, or array? Or can you not pass arrays to functions?

Updated:
Which modifier will guarantee to not change an array argument?


Thanks Guys
Last edited on
---1---
Absolutely.
1
2
3
4
int* foobar()
{
	return new int[1337];
}

As an example.

---2---
Could not parse question.

---3---
Need coffee to parse question, be right back.

-Albatross

EDIT: 13 posts, and counting.
Last edited on
Thanks

Okay I rewrote them...

Updated:
Which function can pass to an array? Is it by value, reference, or array? Or can you not pass arrays to functions?

Updated:
Which modifier will guarantee to not change an array argument?
Unless I've misunderstood something, you're asking if you can pass an array to a function as an argument. Indeed you can pass arrays to functions. When you do, they are passed by reference.

That's an amusing question: "which modifier will guarantee to not change an array argument". Modifiers by definition modify. Does that answer your question?

-Albatross
Last edited on
Yes thanks.

Topic archived. No new replies allowed.