|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: question??
But the (20, 20, 0) is passed to the constructor... I don't remember if AP-class
matrices are always 2D, or if they'd be 3D, too... I'm pretty sure, though, that
apmatrix::apmatrix(20, 20, 0) will set up a 2D array to be a 20x20, with each
element initialized to value 0.
And I dunno why he needs to reference [3][3], that's for whatever the program
is, so I dunno why it should be [3][1] instead... I dunno... I dunno what he's
coding :)
Ben "Telkoth"
telkoth@yahoo.com
Trevor Lindsay wrote:
> I may not remember much about matrices from my class days, but it seems to me
> that if he declares a matrix (20,20,0) then he gets
>
> 20 20 0
>
> yet when he references 3,3
>
> he is asking for
>
> x x x
> x x x
> x x x <- this entry
>
> maybe try 3,1?
>
> it is column then row, am i correct (not much sleep so i could be wrong:)
>
> Ben Hendel-Doying wrote:
>
>> I remember being taught the AP classes in my AP computer science class... I
>> deplored them, but if I remember correctly the way to access a point in the
>> array is _not_ [3,3], it's either by calling a function with (3, 3) or
>> asking
>> for [3][3]. Like I said, I'm not fond of APSTRING, APMATRIX and the like,
>> so I
>> don't know what function you would call to retrieve items in the matrix if
>> [3][3] doesn't work. Also, [4,6] is no good, either.
>>
>> if(data[3][3] == 0)
>> data[4][6] = 1;
>>
>> ??
>>
>> Hope that's helpful,
>> Ben
>> telkoth@yahoo.com
>>
>>
>>
>>
>> > #include<apmatrix.h>
>> >
>> > main()
>> > {
>> > apmatrix<int> data(20,20,0);
>> >
>> > if (data[3,3] == 0)
>> > data[4,6] = 1;
>> > return 0;
>> > }
>> > it will give me an error in the if statement, well if anyone could possibly
>> > help me out please do, and thank you.
>> >
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Talk to your friends online with Yahoo! Messenger.
>> http://im.yahoo.com
>>
>> =================================================================
>> The GameProgrammer.Com mailing list is for the open discussion
>> of any topic related to the art, science, and business of
>> programming games. This list is especially tolerant of beginners.
>> We were all beginners once
>>
>> To SUBSCRIBE or UNSUBSCRIBE please visit:
>> http://gameprogrammer.com/mailinglist.html
>>
>>
>>
>>
>
> ================================================================= The
> GameProgrammer.Com mailing list is for the open discussion of any topic
> related to the art, science, and business of programming games. This list is
> especially tolerant of beginners. We were all beginners once To SUBSCRIBE or
> UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|