gpt4 book ai didi

C编程-如何将输出图片文件设置为.pgm格式?

转载 作者:行者123 更新时间:2023-11-30 17:44:24 25 4
gpt4 key购买 nike

我需要程序自动将其创建为 out1.pgm,而不是要求用户输入输出名称。我该怎么办?

       {
printf("Enter image filename: ");
scanf("%s", fileName);

img = readpic(fileName);

printf("Successfully read image file '%s'\n", fileName);
printf("Adjust brightness: ");
scanf("%d", &brightness);

option1(img, brightness);

printf("Enter image filename for output: ");
scanf("%s", fileName);

writeoutpic(fileName,img);



free(img);
img = NULL;
return(EXIT_SUCCESS);
}

最佳答案

scanf("%s", fileName); 更改为 strcpy(fileName, "out1.pgm");

关于C编程-如何将输出图片文件设置为.pgm格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20013325/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com