c - 写入地址 0x0090000 时发生访问冲突
问题描述
尝试打开此代码时出现此错误:Struct.exe 中的地址 0x7B7EE63C (ucrtbased.dll) 引发异常:0xC0000005:写入地址 0x0090000 时发生访问冲突
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
struct automob {
char marka[15];
int year, price;
};
struct automob1 {
char marka1[15];
int year1, price1;
};
int main()
{
FILE *file, *file1;
struct automob a[5];
fopen_s(&file,"file.txt", "w");
for (int i = 0; i < 5; i++)
{
printf("Enter the mark: ");
scanf_s("%s %d %d", a[i].marka, a[i].year, a[i].price);
fprintf(file, "%s %d %d \n", a[i].marka, a[i].year, a[i].price);
}
fclose(file);
fopen_s(&file, "C:\\Users\\tiama\\source\\repos\\Struct\Struct\\file.txt", "w");
printf("Firm bla bla: \n");
return 0;
}
解决方案
推荐阅读
- python - 当两列具有相同的切换值时填充 NaN 值
- salesforce - NetSuite oauth1.0 - oauth_signature_method= hmac-sha256
- angular - Angular 无法找到样式表警告
- reactjs - 无法解析模块反应导航
- c# - 如何在 Bot Framework .NET for Teams 中处理 CardAction 按钮点击?
- mysql-workbench - 在 MySQL Workbench 中保存视图时我可以停止“美化”吗
- swiftui - 如何使用 addSnapshotListener 获取异步元素的数据数量
- c# - 托管 Blazor WASM - 使用 AAD 进行身份验证,但使用 SQL 中的本地用户角色
- python-3.x - 带有 .png/ .jpeg 图像的散点图标记
- excel - 将 Web 浏览器自动化转换为 XmlHTTP 请求