Arrays as parameters

A

ada_student

I see no compilation errors even in C++ 98 compilation mode:

extern void
copy_array2(int dest[4][5], const int src[4][5])
{
// ...
}

extern void
copy_array(int dest[][5], const int src[][5])
{
// ...
}

Shouldnt there be a compile-time error(duplicate declarations)?

Also, what is the type of int dest[][5]?
 
A

ada_student

Oops! I was too eager in hitting the post message.
I see that the names are different. Sorry about that!

Using the same names, gives me a redefinition error.

Sorry again!
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top