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
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
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?
Summary: I get state below when the size of 2D array more than 2875 x 2875 Exception in thread "main" java.lang.OutOfMemoryError <<no stack trace available>> my program must use array size many many b...
Summary: Hi folks, Using input data from a text (what I've called a *.cdem file) I want to first read this into a 2D array data structure - this works fine. However, I am having problems creating a visualisa...
Summary: I'm writing a class in C++. I need to create a member 2d array but the size is not known until the constructor is called... Currently, in my header I have defined the array: int* i2d; and in the const...