Thread View: comp.windows.misc
1 messages
1 total messages
Started by MORAGA ORELLANA, CORNELIO
Wed, 11 Nov 1992 17:28
Re: problems with a[i][j] within a function
Author: MORAGA ORELLANA, CORNELIO
Date: Wed, 11 Nov 1992 17:28
Date: Wed, 11 Nov 1992 17:28
27 lines
1354 bytes
1354 bytes
> I am a complete novice to X-windows programming (although I know
>C and unix and VMS systems programming at an intermediate level). I
>need to take a 2-dimensional array of colormap indeces, corresponding
>to a rectangular patch of the screen with pixels of different colors,
>and throw it up as a window on a Ultrix VAX or a VMS Vax with
>DecWindows (no MIT X stuff - just regular out-of-the-box DecWindows)
>from a C program. Something like this:
>display_in_window(array)
(array, dim1, dim2)
function display_in_windows can't know dim1 and dim2
if not it specified.
>short array[X][Y];
>{
> /* here's the part I'm having trouble with */
a_ij = array[i][j]; ==> error !!!
it's better to use (though more complex)
a_ij = ((short*)array)[i*dim2+j]; /* this is correct ! */
>}
>
[ ... ]
>Mike Levin
>
cmoraga@dcc.uchile.cl
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads