//源文件中代码
#include "pch.h"
#include "cl1.h"
#include "stdio.h"//File需要引用的文件不然不能够给它一个指针(File* file;)
extern "C"
{
int Add(int a, int b)//加法函数
{
return a + b;
}
}
int Sub(int a, int b) //减法函数
{
return a-b;
}
extern "C"
{
void Write_file()
{
char cA[] = { 'a','b','c','d','1','2','3' };//字符数组(需要写入的)
FILE* fp;//文件指针
fp = fopen("D:\\test1.txt", "w");//打开文件,w是写入,"D:\\test1.txt"被打开的文件名(写入字符的位置)
if (fp == nullptr)//如果写入的文件为空
{
printf("未找到此文件");
}
else如果写入的文件不为空<