Click to See Complete Forum and Search --> : 3 errors that that i don't know how to fix.


quietcoder
July 4th, 2002, 01:38 PM
i'm using Dev-C++ 4

any help in resolving these errors is very much appreciated
1st error: 285 txt2bmp.cpp
case label `'n'' within scope of cleanup or variable array

2nd error: 285 txt2bmp.cpp
jump to case label

3rd error: 53 txt2bmp.cpp
crosses initialization of `class ifstream fin'

although its currently producing 9 errors and 9 warnings

I did find an example windows bmp program at

http://www.csse.monash.edu.au/~tonyj/raytracing/

that did compile. :)

in bitmap.h i modified

void setPixel(int, int, unsigned char, unsigned char, unsigned char);

to

void setPixel(int, int, unsigned char[3], unsigned char[3], unsigned char[3]);


and in bitmap.cpp i modified

void Bitmap::setPixel(int x, int y, unsigned char r, unsigned char g, unsigned char b)

to

void Bitmap::setPixel(int x, int y, unsigned char r[], unsigned char g[], unsigned char b[])

and
red[index(x,y)] = r;
green[index(x,y)] = g;
blue[index(x,y)] = b;

to

red[index(x, y)] = r[3];
green[index(x, y)] = g[3];
blue[index(x, y)] = b[3];

quietcoder
July 5th, 2002, 03:30 AM
:eek: ignore this post. no modification was needed as it was already set up to accept integers for r, g, b, w, and h, i am switching from the case statement to an if for the text menu. that should do it.

sorry for posting this error of my own fault.