Hello all o fyou,
I want to change somewhat a porgram, but because of my minimal knowledge of C++ I hope someone can help.
The below program (only some parts are given) defines the size of a
picture by COLS and ROWS, makes an array with that info and then a
picutre is inputted.
If the cols and rows of the picture are different then the defined one, an error will be presented.
At compile time one needs to know the size of the picture
in p2p.h
/* standard picture: japan 17% comp */
#define
COLS
363 /* number of columns in image */
#define
ROWS
329 /* number of rows in image */
in p2p.c
/* Left and right images */
uchar imgL[ROWS][COLS];
...
pgmReadFile(fnameL, (char *) imgL, &cols, &rows);
if (cols != COLS || rows != ROWS) size_error(cols, rows);
I someway, I would like give the filename and the program then uses the cols and rows of the
actual picture to define the array. So a dynamic array definition (after compiling).
How do I do this? If you can point me some examples on this, that would be great!
Thanks for your help.
All the best,
Victor