我决定学习 C,我尝试遵循本教程http://ricardovelace.com/creating-bitmap-images-with-c-on-windows.html
但是当我尝试使用 gcc 编译我的代码时 >gcc -Wall testc o app
他不知道 type_rgb,我可以定义这个类型吗?如何定义?我的代码在哪里?
#include <stdio.h>
struct rgb_data {
float r, g, b;
};
void save_bitmap( const char *file_name, int width, int height, int dpi, type_rgb *pixel_data);
/*
next steps of the tutorial
*/
rgb_data *pixels = new rgb_data[width * height];
for( int x = 0; x < width; x++)
{
for(int y = 0; y < height; y++)
int a = y * width +x;
{
if ((x > 50 …Run Code Online (Sandbox Code Playgroud)