c++ 函数调用时传参出错,跪求c++达人答疑解惑!急!!! 精彩的答案我会加分滴!! 50

#include<iostream.h>#include<string.h>intlg=0;intmain(){intxLen;intyLen;char*x=newcha... #include <iostream.h>
#include<string.h>
int lg=0 ;
int main()
{
int xLen ;
int yLen ;
char* x=new char[xLen] ;
char* y=new char[yLen] ;
int k=0 ;
cin>>xLen ;
for (int d=0;d<=xLen;d++)
{
cin>>x[d];
}

cin>>yLen;
for (int e=0;e<=yLen;e++)
{
cin>>y[e];
}

for (int j=0;j<=xLen;j++)

{
if (xLen!=yLen) break;
strstr(char x[j],char y[j]);
if (lg==1) k++;
}
if (k=xLen)
{
for(int w=0;w<=xLen;w++)
{
cout<<x[w]<<"/"<<y[w]<<" " ;
}
}
else
{
cout<<"不能合一!";
}
delete x ;
delete y ;
return 0;
}

int strstr(char a, char b){

int i=0 ;
char*p=&a ;
char*q=&b ;
while(*(p+i)!=NULL && *(q+i)!=NULL){
if (*(q+i)==*(p+i))
i++ ;
else{
q++ ;
i=0 ;
}
}
if (*(p+i)==NULL)
{ lg=1 ;
return lg ;}
}
C:\Windows\System32\1111.cpp(27) : error C2144: syntax error : missing ')' before type 'char'
C:\Windows\System32\1111.cpp(27) : error C2660: 'strstr' : function does not take 0 parameters
C:\Windows\System32\1111.cpp(27) : error C2059: syntax error : ')'
展开
 我来答
yunlkong
2011-07-12 · TA获得超过5711个赞
知道大有可为答主
回答量:9695
采纳率:0%
帮助的人:1.9亿
展开全部
printf("\t\t\t1. 输入学生成绩记录 Enter the record\n"); /*输入学生成绩记录*/
printf("\t\t\t2. 显示 Print the record\n"); /*显示*/
printf("\t\t\t3. 寻找 Search record on name\n"); /*寻找*/
printf("\t\t\t4. 删除 Delete a record\n"); /*删除*/
printf("\t\t\t5. 排序 Sort to make New a file\n"); /*排序*/
printf("\t\t\t6. 插入 Insert record to list\n"); /*插入*/
printf("\t\t\t7. 保存 Save the file\n"); /*保存*/
printf("\t\t\t8. 读取 Load the file\n"); /*读取*/
printf("\t\t\t9. 退出 Quit\n"); /*退出*/
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
kissofblueice
2011-06-27 · TA获得超过471个赞
知道小有建树答主
回答量:814
采纳率:100%
帮助的人:574万
展开全部
strstr(char x[j],char y[j]);

改成strstr(&x[j],&y[j]);
调用函数不需要带参数类型的。
strstr函数原型是str *strstr(char *str1,char *str2)查找str1中str2的字串,返回str2在str1中第一次出现的首地址。
更多追问追答
追问
改了之后没语法错误了,但是运行调试过程中程序突然中断了,能帮我再看看吗?
追答
仔细一看。。错误一大堆。。
完全不知道你的程序是想完成什么功能
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2011-07-06
展开全部
完全没有看到你用数据结构啊??

只看到你包括了
void menu();
void add();
void sub();
void mul();
void div1();
void main();
这样六个函数 。

楼上的都忽略主函数main了
另外,站长团上有产品团购,便宜有保证
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式