Why wont this compile on DEV

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <cstdlib>
#include <iostream>

using namespace std;

class setTime{
      
      public:
      
      setTime(int d=0, int m=1, int y=1900){
                  :day(d),month(m),year(y)
                  {
                  }
      int getday(){
          return day;
          }
      int getmonth(){
          return month;
          }
      int getyear(){
          return year;
          }
      int displaydate(){
          
          cout<<" Date is, "<<day<<"/"<<"/"<<month<<"/"<<year;
          }
          
      private:
              const int day;
              const int month;
              const int year;
              };

int main()
{
    
    int year, day, month;
    
    cout<<"What year: ";
    cin>> year;
    cout<<"/nThe day: ";
    cin>> day
    cout<<"/nThe month: ";
    cin>> month;
    
    
    setTime nTime(day,month,year);
    nTime.displaydate();
    

    system("PAUSE");
    return EXIT_SUCCESS;
}
Last edited on
closed account (3hM2Nwbp)
What's the compiler error message? (Could you paste it please?)
Offhand, is 'EXIT_SUCCESS' defined?
Thats the thing, Dev Bloodshed doesnt give any details about errors it just says, Build Error.. If it gave me some details I wouldnt have so many problems compiling.
Missing a semicolon on line 42. Have an extra { on line 10 (before the initializer list).

And I'm sure there is a way to actually see the error messages. I'm not familiar with your compiler though so I couldn't help you with that. Perhaps there is some documentation you could look at?
Yeah, if I could learn to see the details of the errors, than I wouldn't have to post "Why wont this compile"


So does anyone know how to bring up the error details for Dev Bloodshed???
I usually use the 'compiler' tab (usually) found on the bottom left of Dev Bloodshed...

It gives you the line number where the problem was found (or near it), the file and a handy message usually saying something like..." expected '{' before initializer..."...

I'm pretty sure that's as good as the error details get after compiling within Bloodshed.
(I couldn't live without it, with the amount of typing 'errots' I make... :p)
Hope it helps...
closed account (S6k9GNh0)
Dev-C++ is a bit old yeah? I would suggest getting: http://wxdsgn.sourceforge.net/
It is heavily wx oriented but is for the most part, an extension of Dev-C++. They even have their own forums.
Topic archived. No new replies allowed.