WHY CANT I ACCESS: error()

i used the following headers on visual studio:

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

but yet, i have been unable to use "error()"

I'm writing a program, i intend to write:

_______________________________________________________________________________
if(d==0)
error("You are dividing by zero")
_______________________________________________________________________________

What do i do??
If I am not mistaken there is no such function error in C/C++.
So you should define the function yourself.
how?

Im using programming principles and practice by Bjarne Stroustrup (the author of c++)

he uses it.
Function error is defined in header "std_lib_facilities.h" that you should include in your programs.
Here is the supporting site http://www.stroustrup.com/Programming/
To access the header select •Standard library access header in the page.
Last edited on
@vlad_from_moscow i did, but the site is a HTML page
And what?
First line under "Supporting code" on that page is the following link:
http://www.stroustrup.com/Programming/std_lib_facilities.h
Open that link and save the file.
oh! i save the page? thanks

sorry @vlad_from_moscow didnt get you at first. was expecting a file not a page
Topic archived. No new replies allowed.