View Single Post
Old Oct 27th, 2005, 7:47 PM   #30
D-Ferg27
Programmer
 
D-Ferg27's Avatar
 
Join Date: Oct 2005
Posts: 49
Rep Power: 0 D-Ferg27 is on a distinguished road
why is it that most tutorials don't put the right code in. Im using dev-C++ and practically all code that is written in a turorial doesn't work for me for instance this.

// Sample program
// IEA September 1995
// Reads values for the length and width of a rectangle
// and returns the perimeter and area of the rectangle.

#include <iostream.h>

void main()
{
  int length, width;
  int perimeter, area;              // declarations
  cout <<  "Length = ";             // prompt user
  cin >> length;                    // enter length
  cout << "Width = ";               // prompt user
  cin >> width;                     // input width
  perimeter = 2*(length+width);     // compute perimeter
  area = length*width;              // compute area
  cout << endl
       << "Perimeter is " << perimeter;
  cout << endl
       << "Area is " << area
       << endl;                    // output results
} // end of main program

and i got it from this part of a tutorial this site

im actually starting to think that devC++ is not a standard compiler and thats why most code that i get from tutorials dont work. Is this true. Is there a better compiler?

Last edited by D-Ferg27; Oct 27th, 2005 at 8:03 PM.
D-Ferg27 is offline   Reply With Quote