Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to change

  • for(int i=0;iheight;i=i++) to for(int i=0; i < img->height; i++) and
  • for(int j=0;jwidth;j++) to for(int j=0; j < img->width; j++).

<img-> was incorrectly identified as a HTML tag and because the browser does not understand that tag, it ignores it.

Generally, you should try to understand the source code, that you are trying to compile :-).

BTW: In case of inexplicable crashes:

  1. Assume, you are accessing a resource, that has not been initialized yet.
  2. Prove the assumption to be wrong.
  3. Assume, you are accessing an array beyond its bounds.
  4. Prove the assumption to be wrong.
  5. ...