C2660 “__stdio_common_vfscanf”: 函数不接受 4 个参数

没人爱的小白 2018-09-26 05:38:31
VS使用小白一个,刚专用VS写c代码时报的错误:C2660 “__stdio_common_vfscanf”: 函数不接受 4 个参数
有图:
有大佬知道怎样解决?求告知
...全文
1454 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-09-27
  • 打赏
  • 举报
回复
VS IDE中,在不明白的符号上点鼠标右键,选转到定义。
没人爱的小白 2018-09-27
  • 打赏
  • 举报
回复

//main函数在这里
#include "Top_List.h"
//201741402223_黄国铸
void main(void)
{
SeqList head1,head2,head3;

//1.初始化函数
ListInitiate(&head1);
ListInitiate(&head2);
ListInitiate(&head3);

//2.赋初值或插入函数
char flag[5]={'0','1','2','3','4'};
for(int i=0;i<5;i++)
{
ListInsert(&head2,flag[i]);
}
int item=0;
printf("输入1测试int数据;输入2测试char数据\n");
printf("请输入操作:");
scanf("%d",&item);
if(item==1)
{
char flagInt[8]={'3','1','4','5','9','2','6','8'};
for(int j=0;j<8;j++)
ListInsert(&head1,(int)flagInt[j]);
}
else if(item==2)
{
char flagChar[11]={'h','u','a','n','g','g','u','o','z','h','u'};
for(int s=0;s<11;s++)
ListInsert(&head1,(int)flagChar[s]);
}
else
{
printf("输入操作错误!\n");
}

//3.删除函数
int x;
if (ListDelete(&head1,2,&x))
printf("已经删除2处元素%c\n", (char)x);
else
printf("删除操作失败\n");

//4.取元素函数
int data1;
if (ListGet(head1,2,&data1))
printf("在位置参数2处取出元素%c\n",(char)data1);
else printf("取出失败\n");

//5.获得当前数据个数
int k=0;
k=ListLength(head1);
printf("head1表当前数据元素个数为%d\n",k);

//6.合并数表函数
int d=0,data2;
printf("输出head1表的所有元素:");
while(ListGet(head1, d, &data2))
{
printf("%c ",(char)data2);
d++;
}
printf("\n");
printf("输出head2表的所有元素:");
int m=0,data3;
while(ListGet(head2, m, &data3))
{
printf("%c ",(char)data3);
m++;
}
printf("\n");
int n=0,data4;
if (ListMerge(head1, head2, &head3))
{
printf("合并后的head3数表的所有元素:");
while(ListGet(head3, n, &data4))
{
printf("%c ",(char)data4);
n++;
}
}
}
没人爱的小白 2018-09-27
  • 打赏
  • 举报
回复

//头文件代码在这里
#include <stdio.h>
#define MaxSize 100//顺序表最大存入为100
#define DataType int //存入数据类型暂时为int

typedef struct
{
DataType list[MaxSize];
int size;
}SeqList; //有序顺序表


//1.初始化
/*
将size赋值为0
*/
//不设置返回值
void ListInitiate(SeqList *L)
{
L->size=0;
}

//2.顺序表插入元素
/*
1.确认顺序表是否够存储空间
2.找到存入位置
3.放空存入位置
4.存入
5.size+1
*/
//插入成功返回1;插入失败返回0;
int ListInsert(SeqList *L, DataType x)
{
int j;
if (L->size >= MaxSize)
{
printf("顺序表已满,无法插入!\n");
return 0;
}
else
{
//从前往后找,直到找到比x大的元素,
for (int i=0;i<L->size;i++)
{
if (L->list[i] > x)
{
//从后往前依次后移数据,为插入做准备
for (j = L->size; j > i; j--)
L->list[j] = L->list[j - 1];
L->list[i] = x;
L->size++;
return 1;
}
}
L->list[L->size]=x;
L->size++;
return 1;
}
}

//3.求当前数据元素个数
/*
返回当前size值
*/
//返回当前size值
int ListLength(SeqList L)
{
return L.size;
}

//4.删除i位置元素
/*
1.保存i处元素
2.从前往后前移i后的元素
3.size值减一
*/
//成功返回1;失败返回0;
int ListDelete(SeqList *L, int i, DataType *x)
{
int j;
if (L->size <= 0)
{
printf("顺序表已空,无数据元素可以删除\n");
return 0;
}
else if(i<0||i>L->size-1)
{
printf("参数i不合法!\n");
return 0;
}
else
{
*x = L->list[i];
//从前往后前移i后的元素
for (j=i+1;j<=L->size-1;j++)
L->list[j - 1] = L->list[j];
L->size--;
return 1;
}
}

//5.取数据元素
/*
*x传回i处元素的值
*/
//成功返回1;失败返回0
int ListGet(SeqList L, int i, DataType *x)
{
if(i<0||i>L.size-1)
{
printf("参数不合法!\n");
return 0;
}
else
{
*x = L.list[i];
return 1;
}
}

//6.合并顺序表
/*
1.保证L2和L3的数据元素之和不大于L3的MaxSize
2.将L1和L2所有元素插入L3
3.计算插入个数与L1、L2的size之和比较
*/
//成功返回1;失败返回0;
int ListMerge(SeqList L1, SeqList L2, SeqList *L3)
{
if ((L1.size + L2.size) >= MaxSize)
{
printf("总元素值超过最大存入了,不能合并\n");
return 0;
}
int item=0,flag=0;
for(int i=0;i<L1.size;i++)
{
if(ListInsert(L3,L1.list[i]))
item++;
}
for(int j=0;j<L2.size;j++)
{
if(ListInsert(L3,L2.list[j]))
flag++;
}
if((flag+item)==(L1.size+L2.size))
return 1;
else return 0;
}
没人爱的小白 2018-09-27
  • 打赏
  • 举报
回复
我在VC编译通过啦,就是用VS不行
www_adintr_com 2018-09-26
  • 打赏
  • 举报
回复
看你自己写的代码啊, 你截一个系统文件的图来说明什么...

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧