Computing.Net > Forums > Programming > extern 2d array

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

extern 2d array

Reply to Message Icon

Name: Pashka
Date: February 14, 2008 at 13:09:40 Pacific
OS: windows XP
CPU/Ram: AMD 64
Product: AMD
Comment:

May be it`s a stupid question, but how can I use extern on 2d arrays?
When I declare in header
extern int array[][]

and then define in cpp file
int array[ROW_SIZE][COLUMN_SIZE]

it give me an error:
Error 1 error C2087: 'array' : missing subscript
Error 10 error C2087: 'array' : missing subscript
Error 21 error C2087: 'array' : missing subscript
Error 28 error C2369: 'array' : redefinition; different subscripts

Please help



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: February 15, 2008 at 06:03:07 Pacific
Reply:

Have you tried

extern int array[ROW_SIZE][COLUMN_SIZE]


0

Response Number 2
Name: Pashka
Date: February 17, 2008 at 07:31:48 Pacific
Reply:

Yes, it didn`t work...


0

Response Number 3
Name: klint
Date: February 18, 2008 at 09:49:24 Pacific
Reply:

I don't see anything wrong with Razor's suggestion. It should work. Of course, you need to have the constants ROW_SIZE and COLUMN_SIZE defined at the point where you have your declaration. Could that be the problem?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: extern 2d array

why 2d array java limited only this www.computing.net/answers/programming/why-2d-array-java-limited-only-this/8627.html

Graphical 2D Array Display VB.NET www.computing.net/answers/programming/graphical-2d-array-display-vbnet/11062.html

Dynamicly-sized C++ 2D array www.computing.net/answers/programming/dynamiclysized-c-2d-array/11478.html