http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question??



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:
3A241854.72F4E0B4@yahoo.com">
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
  • Follow-Ups:
  • References: