efn
thank you its working. i specified all dimesions. i think its always good to specify ALL the dimension.
Main Topics
Browse All Topicshi i am getting compilation error...i have 3 files.
x.cpp
---------
#include<stdio.h>
void func(int a[10][10][10][10],int b[20]);
void func1(int a[][][][],int c[20]);
int main()
{
static int a[10][10][10][10],b[20],c[
func(a,b);
printf("val1 = %d\n val2=%d\n",a[5][5][5][5],b
func1(a,c);
printf("a[2][2][2][2] = %d\n c[6] %d\n",a[2][2][2][2],c[6]) ;
}
y.cpp
-------
void func(int a[10][10][10][10],int b[20])
{
a[5][5][5][5] = 120;
b[12] = 14;
}
z.cpp
--------
void func1(int a[][][][],int c[])
{
a[2][2][2][2]=7;
c[6]=8;
}
then add to project in VC++> rebuild all
....... but getting compilation error!!!
i am giving my error below
--------------------------
x.cpp
c:\documents and settings\pressenter\deskto
c:\documents and settings\pressenter\deskto
c:\documents and settings\pressenter\deskto
c:\documents and settings\pressenter\deskto
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\pressenter\deskto
y.cpp
Error executing cl.exe.
x.exe - 4 error(s), 1 warning(s)
why error and how can i remove this??? am i syntactically wrong anywhere???
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: efnPosted on 2003-12-28 at 08:33:00ID: 10007624
You can't declare an array parameter with four unspecified dimensions like "a[][][][]". The compiler won't know how to find its way around in the array. You have to specify the bounds of all dimensions except the first, for example, "a[][10][10][10]".
--efn