how to add the mobile number in the employee information system in c language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthisargunan
    New Member
    • Jan 2009
    • 3

    how to add the mobile number in the employee information system in c language

    Hello,
    I am developing the project of "Employee Information System" using C language, In this project i want to add the mobile number for the each employee {Each Mobile number having 7 characters, Bcoz if we using the integer means, Any of one employee has no mobile number it’s not print the "0000000" format of mobile number} So if it okay means You will send the clear details about, "How to add the mobile number and also How to increase that to each employee ASAP.
    Contact Mail ID : <removed>

    Thanks & Regards,
    B.Karthikeyan
    Last edited by Banfa; Jan 21 '09, 12:06 PM. Reason: Removed email addresses, removed bold on full message
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Hi,
    Whats ur requirement?
    You want to know how to add this to a structure or wht u want to do?

    Raghu

    Comment

    • karthisargunan
      New Member
      • Jan 2009
      • 3

      #3
      HI,

      I store employee's 7digit phone number as string. I want to allocate numbers to them For each employee the phone number should be 1 value greater than previous employee.
      So, I need to increment ph number by 1.
      How to increment a string?
      Regards,
      Karthikeyan.B

      Comment

      • osfreak
        New Member
        • Oct 2008
        • 22

        #4
        Get the last character of the string using a char pointer.

        check if value is not '9' {
        // value is not '9'
        increment the value at the position

        } else {
        //value is '9'
        replace the value of '9' to '0'

        }

        Comment

        • Banfa
          Recognized Expert Expert
          • Feb 2006
          • 9067

          #5
          Convert the string to an integer, increment the integer and then convert the integer back to a string.

          Alternatively if this is initialisation just hold the number as an integer and convert it to a string and increment it as you instantiate each employee.

          Comment

          Working...