int counter = 0;
char *jpg_name;
sprintf(jpg_name, "%3i.jpg", counter);
FILE *photo = fopen( jpg_name, "w");
counter++;
次のエラーが発生し続けます。
'jpg_name' may be used uninitialized in this function [-Werror=uninitialized]
関数を使用してファイル名を書き込もうとしていsprintf
ます。どういうわけか間違った方法で宣言しているに違いないと思いますがchar*
、正しく行う方法がわかりません。