CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    16

    3 errors that that i don't know how to fix.

    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];
    Attached Files Attached Files
    logical coding for functional programs

  2. #2
    Join Date
    Jun 2002
    Posts
    16
    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.
    logical coding for functional programs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured