Thread: File Input and Output with error checking

  1. #16
    Tweaking master Aslaville's Avatar
    Join Date
    Sep 2012
    Location
    Rogueport
    Posts
    528
    Quote Originally Posted by Magi View Post
    It's still not increasing the pay.
    This is not a comprehensive reply because I do not know what you did.
    Member functions that are labeled const do not change the attributes of the class.I can see that all your member functions are labelled const.
    If you want to change the salaries of your classes well I think you should define two functions one for changing the salaries by whatever value and another for getting the salaries.
    Code:
    //get the salaries
     double get_monthly_pay() const {return monthly_pay;}
    //change the salaries
    double change_salaries () { monthly_pay += 50.00 ; }
    Now go read something about member functions.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Please indent your code properly, as well.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with error checking on input from user.
    By NuNn in forum C Programming
    Replies: 8
    Last Post: 01-23-2009, 12:59 PM
  2. error checking file
    By Nexus-ZERO in forum C Programming
    Replies: 11
    Last Post: 01-29-2008, 04:02 AM
  3. Replies: 4
    Last Post: 04-03-2007, 05:57 AM
  4. Writing to a file checking if the input is new
    By BianConiglio in forum C Programming
    Replies: 3
    Last Post: 07-18-2005, 05:59 AM
  5. Error checking user input
    By theharbinger in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2003, 09:57 AM

Tags for this Thread