Search:
Forum
Beginners
Code run on Dev C++ but error in CodeBlo
Code run on Dev C++ but error in CodeBlock
Oct 6, 2013 at 5:28am UTC
reddevil cplus2
(7)
Hey ,i'm a beginner and just start study C++ in few month. Why my coding wont run in CodeBlock but work in Dev C++. Your help would we very appreciated :)
#include <iostream>
using namespace std;
int kira(int,int);
int main()
{
int l,w;
cout<<"Enter length :";
cin>>l;
cout<<"Enter width :";
cin>>w;
cout<<"Area of rectangle is :"<<kira(l,w)<<endl;
system ("pause");
return 0;
}
int kira(int length , int width)
{
int area;
area=length*width;
return area;
}
Oct 6, 2013 at 5:35am UTC
reddevil cplus2
(7)
The error >>
http://imageshack.us/f/837/abik.png/
Oct 6, 2013 at 5:37am UTC
firedraco
(6243)
system is not required to be defined by iostream.
I believe cstdlib is the header file you need for system.
Oct 6, 2013 at 5:53am UTC
reddevil cplus2
(7)
Thanks firedraco. Now it worked.
I deleted => system ("pause"); .
Still wondering why it work after I deleted it , hurmmm.
Oct 6, 2013 at 6:02am UTC
reddevil cplus2
(7)
ooh , and cstdlib doesn't work
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs