Thread: New To C++

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    24

    New To C++

    OK guys am kinda new to c++ but I have a bit of knowledge about c though. The other day in class I wrote this code but it wont compose on visual c++, am asking for some help because I got an error I don't understand, Thanks in Advance. The Code Is As Follows:
    Code:
    /Date.h
    
    
    #ifndef DATE_H
    #define DATE_H
    #include<iostream>
    using std::cout;
    class Date{
    			private : int day, month, year;
    			public : 
    				Date( )//constructor
    				{
    					day = month = year = 0;
    				}
    					Date(int d, int m, int y)//primary constructor
    					{
    						setDay(d);
    						setMonth(m);
    						setYear(y);
    				
    					}
    
    void setDay (int d)
    {
    	day = (d>=1&& d<=31)?d:0;
    }
    void setMonth (int m)
    {
    	month = (m>=1 && m<= 12)?m:0;
    }
    void setYear (int y)
    {
    	year = (y>=0 && y<= 9999)?y:0;
    }
    
    int getDay () {return day;}
    int getMonth() {return month;}
    int getYear(){return year;}
    
    void display(){
    	cout << day <<"/"<<year<<"/"<<year"/";
    }
    };// closes the class 
    #endif
    The error it says am getting is a build error : 1>------ Build started: Project: Drivers_License, Configuration: Debug Win32 ------
    1>Embedding manifest...
    1>.\Debug\Drivers_License.exe.intermediate.manifes t : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
    1>Build log was saved at "file://c:\Users\admin\Documents\SCIT 2D\C++\Drivers_License\Drivers_License\Debug\Build Log.htm"
    1>Drivers_License - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    When I try to compile it also in borland I only get one error which is a statement missing error(.
    Last edited by frassunit; 01-31-2009 at 10:50 AM. Reason: Adding the errors.

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    46
    I believe your display() looks like this:
    Code:
    void display(){
    	cout << day <<"/"<<year<<"/"<<year"/";
    }
    and it should be
    Code:
    void display(){
    	cout << day <<"/"<<year<<"/"<<year<<"/";
    }
    After I corrected that it compiled just fine.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    24
    Thanks, it compiles perfectly in borland, but i still get a build error in visual c++.

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by frassunit View Post
    OK guys am kinda new to c++ but I have a bit of knowledge about c though.
    OK; better if we assume assume you know nothing about C++ then. Good habits in C often translate to bad habits in C++, and vice versa.

    Quote Originally Posted by frassunit View Post
    The error it says am getting is a build error : 1>------ Build started: Project: Drivers_License, Configuration: Debug Win32 ------
    1>Embedding manifest...
    1>.\Debug\Drivers_License.exe.intermediate.manifes t : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
    1>Build log was saved at "file://c:\Users\admin\Documents\SCIT 2D\C++\Drivers_License\Drivers_License\Debug\Build Log.htm"
    1>Drivers_License - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    When I try to compile it also in borland I only get one error which is a statement missing error(.
    Well, JacobN has explaned the error from Borland's compiler. I'm surprised you don't report a similar one with Visual Studio.

    However, this error message is unrelated to your code: it's a compiler configuration or usage problem (ie caused by tweaks you or someone else has done in settings).

    Depending on version of Studio you're using, I would guess the offending settings are in the IDE "Build/Configuration Manager" window. That's only a guess though, as you haven't provided enough information and there are many possibilities.

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Your compiler would be ... VS2008 Express?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed