| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 621 人关注过本帖
标题:请教一个C语言问题,顺便看看有没有其他问题 strcat cannot convert parame ...
取消只看楼主 加入收藏
daniel_zeng
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2014-5-29
结帖率:0
收藏
 问题点数:0 回复次数:0 
请教一个C语言问题,顺便看看有没有其他问题 strcat cannot convert parameter 1 from 'char' to 'char *'
#include <process.h>
#include <string.h>
#include <stdio.h>
void zj();                                                                       
void find(); //查找某同学的量化分的函数
struct  stu
{
    char *name;
    int number;
    float garde;
    char reason;
}boy[59][4]={
    {"张三",2014070101,0,'\0'},
    {"李四",2013070102,0,'\0'},
    {"王五",2014070103,0,'\0'},
    {"赵六",2014070104,0,'\0'},
};
main()
{
    int choose=0;
    printf("*****             1.查询量化分                                   *****\n");
    printf("*****             2.添加量化分                                   *****\n");
    scanf("%d",&choose);
    if (choose==1)
        find();
    if (choose==2)
        zj();
    void zj();                                                                      //添加量化分
    int i,n;                                                                //定义变量
    char e='\0';
    float a=0.0000;
   for (i=0;i<4;i++)  
    {again:
      printf("************************************");
      printf("     姓名:    ","%s\n",boy[i][1].name);
      printf("     学号:    ","%d\n",boy[i][2].number);
      printf("     量化分:  ","%f\n",boy[i][3].garde);
      printf("     加分细则:","%s\n",boy[i][4].reason);
      printf("************************************");
      printf("     请输入量化分数,输入0则跳转下一名同学");//输入量化分细则
      scanf("%f\n",&a);
   if (a==0)
    continue;                       //跳转下一位
   printf("     请输入量化分加分细则");   //选择细则,或输入细则
   scanf("%c\n",&e);
   printf("     您输入的量化分数为:\n");
   printf("%f\n",a);
   printf("     您输入的量化分加分细则为:\n");
   printf("%s\n",e);
   printf("是否保存?不保存请输入n,任意键保存");
   scanf("%d",&choose);
    if (choose==n)//如果不保存,返回again处
     goto again;
       boy[i][3].garde+=a;
      strcat((char)boy[i][4].reason,e);
    return(boy[i][3].garde,boy[i][4].reason);}
    printf("001");
    void find();
        again: printf("请输入查询学生的姓名或学号");  
    scanf("%s\n",&find);
    for(i=0;i<4;i++)
    if ((char)boy[i][1].name==(char)find|| (char)boy[i][2].number)                                                               
    {
        printf("     姓名:    ","%s\n",boy[i][1].name);
        printf("     学号:    ","%d\n",boy[i][2].number);
        printf("     量化分:  ","%f\n",boy[i][3].garde);
        printf("     加分细则:","%s\n",boy[i][4].reason);
        printf("是否继续查找?不查找请输入n,,其余任意键继续查询,");
         scanf("%d",&choose);
        if (choose==n)   //退出查找
             continue;
           goto again;
        }
    }
搜索更多相关主题的帖子: convert include cannot number reason 
2014-05-29 18:25
快速回复:请教一个C语言问题,顺便看看有没有其他问题 strcat cannot convert p ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038212 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved