阅读背景:

为什么这个程序在C崩溃?

来源:互联网 
#include <stdio.h>
#include <stdlib.h>
#include "imageio.h"
#include "imageio.c"

int main()
{
    int i,j;
    IMAGE image = loadImage("test.bmp");
    printf("Enter the number of pixels in the x axis: ");
    scanf("%d", &image.width);
    printf("Enter the number of pixels in the y axis: ");
    scanf("%d", &image.height);
    for (i=0;i<image.width; i++)
      for (j=0;j<image.height; j++){
            RGB pixel = image.pixels[i][j];
            pixel.R = pixel.R * 0.299;
            pixel.G = pixel.G * 0.587;
            pixel.B = pixel.B * 0.114;
            image.pixels[i][j] = pixel;
      }
    saveImage("modified_test.bmp", image);
}
#include <stdio.h>
#include <stdlib.h>
#include



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: