求助高手C++中 error()函数的头文件是什么

yangsf_shaoluting yangsf_shaoluting 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include <iostream>

using namespace std;
int area(int length_2,int width_2);

main()
{
int length;
int width;
int S;
cin>>length>>width;

if(length<=0) error("non-positive length\n");
if(width<=0) error("non-positive width\n");

S=area(length,width);//ÕâÀïÃæÓÐbug£¬Òª¿¼ÂÇfushu
cout <<"area="<<S<<endl;

}
int area(int length_2,int width_2)
{
return length_2*width_2;

}

//-----------------------------------------------------------
//我是刚学C++,error()和printf()的区别是什么,这两者的效果有什么不一样
...全文

相关推荐

Linux C 编成入门

适合于初学者看的,简单的介绍了Linux下C所需要掌握的基础知识和一些工具的使用

shengqi542

VSCode配置C/C++并添加非工作区头文件的方法

主要介绍了VSCode配置C/C++并添加非工作区头文件的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

weixin_38621870

VSCode添加头文件(C/C++)的实现示例

Enable pretty-printing for gdb

weixin_38736652

C++基于LOG4CPP的使用封装库

代码是C++,基于LOG4CPP进行封装日志,适用于Linux环境,使用过程时,对其进行继承即可套用其结构

逍_遥_子

本人精心收集,c++头文件一览

本人收集: C/C++头文件一览 C、传统 C++ #include &lt;assert.h&gt;    //设定插入点 #include &lt;ctype.h&gt;     //字符处理 #include &lt;errno.h&gt;     //定义错误码 #include &lt;float.h&gt;     //浮点数处理 #include &lt;fstream.h&gt;    //文件输入/输出 #include &lt;iomanip.h&gt;    //参数化输入/输出 #include &lt;iostream.h&gt;   //数据流输入/输出 #include &lt;limits.h&gt;    //定义各种数据类型最值常量 #include &lt;locale.h&gt;    //定义本地化函数 #include &lt;math.h&gt;     //定义数学函数 #include &lt;stdio.h&gt;     //定义输入/输出函数 #include &lt;stdlib.h&gt;    //定义杂项函数及内存分配函数 #include &lt;string.h&gt;    //字符串处理 #include &lt;strstrea.h&gt;   //基于数组的输入/输出 #include &lt;time.h&gt;     //定义关于时间的函数 #include &lt;wchar.h&gt;     //宽字符处理及输入/输出 #include &lt;wctype.h&gt;    //宽字符分类 ////////////////////////////////////////////////////////////////////////// 标准 C++ (同上的不再注释) #include &lt;algorithm&gt;    //STL 通用算法 #include &lt;bitset&gt;     //STL 位集容器 #include &lt;cctype&gt; #include &lt;cerrno&gt; #include &lt;clocale&gt; #include &lt;cmath&gt; #include &lt;complex&gt;     //复数类 #include &lt;cstdio&gt; #include &lt;cstdlib&gt; #include &lt;cstring&gt; #include &lt;ctime&gt; #include &lt;deque&gt;      //STL 双端队列容器 #include &lt;exception&gt;    //异常处理类 #include &lt;fstream&gt; #include &lt;functional&gt;   //STL 定义运算函数(代替运算符) #include &lt;limits&gt; #include &lt;list&gt;      //STL 线性列表容器 #include &lt;map&gt;       //STL 映射容器 #include &lt;iomanip&gt; #include &lt;ios&gt;       //基本输入/输出支持 #include &lt;iosfwd&gt;     //输入/输出系统使用的前置声明 #include &lt;iostream&gt; #include &lt;istream&gt;     //基本输入流 #include &lt;ostream&gt;     //基本输出流 #include &lt;queue&gt;      //STL 队列容器 #include &lt;set&gt;       //STL 集合容器 #include &lt;sstream&gt;     //基于字符串的流 #include &lt;stack&gt;      //STL 堆栈容器     #include &lt;stdexcept&gt;    //标准异常类 #include &lt;streambuf&gt;    //底层输入/输出支持 #include &lt;string&gt;     //字符串类 #include &lt;utility&gt;     //STL 通用模板类 #include &lt;vector&gt;     //STL 动态数组容器 #include &lt;cwchar&gt; #include &lt;cwctype&gt; using namespace std; ////////////////////////////////////////////////////////////////////////// C99 增加 #include &lt;complex.h&gt;   //复数处理 #include &lt;fenv.h&gt;    //浮点环境 #include &lt;inttypes.h&gt;  //整数格式转换 #include &lt;stdbool.h&gt;   //布尔环境 #include &lt;stdint.h&gt;   //整型环境 #include &lt;tgmath.h&gt;   //通用类型数学宏

wpt_007
评论 7
收藏 已收藏
分享
返回顶部
yangsf_shaoluting
C++ 语言 65,214 成员 250,514 内容