| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 458 人关注过本帖
标题:这段代码哪里错了?
只看楼主 加入收藏
给力小青年
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2011-11-20
结帖率:78.57%
收藏
已结贴  问题点数:10 回复次数:3 
这段代码哪里错了?
#include "stdafx.h"
#include<stdio.h>
#define A 5
void b(const double c[], int d);
void l(double c[], int d, double aa);
int main(void)
{
    double a[A] = {20.0, 17.66, 8.2, 15.3, 22.22};
    printf("fggdfgdhd\n");
    b(a, A);
    l(a, A, 2.5);
    printf("hfhgf\n");
    b(a, A);
    getchar();
    return 0;
}
void b(const double c[], int d)
{
    int i;
    for(i = 0; i < c; i++)
        prinft("%8.3f", c[i]);
    putchar("\n");
}
void e(double c[], int d, double aa)
{
    int i;
    for(i = 0; i < c; i++)
        c[i] *= aa;
}
搜索更多相关主题的帖子: include double return 
2011-12-21 23:10
lijy520
Rank: 2
等 级:论坛游民
帖 子:119
专家分:42
注 册:2007-8-8
收藏
得分:7 
for(i = 0; i < c; i++)        c 为数组首地址

还有最好贴出错误提示内容啊
手机党没有编译器

2011-12-21 23:25
给力小青年
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2011-11-20
收藏
得分:0 
--------------------Configuration: hffdsa - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
hffdsa.cpp
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(23) : error C2446: '<' : no conversion from 'const double []' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(23) : error C2040: '<' : 'int' differs in levels of indirection from 'const double []'
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(24) : error C2065: 'prinft' : undeclared identifier
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(25) : error C2664: '_flsbuf' : cannot convert parameter 1 from 'char [2]' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(30) : error C2446: '<' : no conversion from 'double []' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(30) : error C2040: '<' : 'int' differs in levels of indirection from 'double []'
执行 cl.exe 时出错.

hffdsa.exe - 1 error(s), 0 warning(s)
2011-12-21 23:28
给力小青年
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2011-11-20
收藏
得分:0 
--------------------Configuration: hffdsa - Win32 Debug--------------------
Compiling...
hffdsa.cpp
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(23) : error C2446: '<' : no conversion from 'const double []' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(23) : error C2040: '<' : 'int' differs in levels of indirection from 'const double []'
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(25) : error C2664: '_flsbuf' : cannot convert parameter 1 from 'char [2]' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(30) : error C2446: '<' : no conversion from 'double []' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\迅雷下载\MyProjects\hffdsa\hffdsa.cpp(30) : error C2040: '<' : 'int' differs in levels of indirection from 'double []'
2011-12-21 23:29
快速回复:这段代码哪里错了?
数据加载中...
 
   



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

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