sorting of date,monthand year of 3 entity using structure

This is a discussion on sorting of date,monthand year of 3 entity using structure within the C Programming forums, part of the General Programming Boards category; i want to write a program to sort out details of date,month,year using structure. if year of 1stand 2nd entity ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    2

    Question sorting of date,monthand year of 3 entity using structure

    i want to write a program to sort out details of date,month,year using structure.
    if year of 1stand 2nd entity are same then go for checking month.i tried this ,but did not got required output.i think there is a mistake in my program attached .please correct me where have i gone wrong .i am new to programming.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Sep 2010
    Location
    Halesowen, England
    Posts
    30
    The easiest way to sort date is to output it like YYYY-MM-DD and then perform an alphabetic sort.

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    2
    i attached a program which did not get executed as i mentioned .please correct my program.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    You can't say:
    Code:
    e[3],t;
    Because there is no data type specified.

    Please post code (anything reasonably short), as code, between code tags, so it's easy to study, rather than attaching it as a file.

    In the advanced reply window, highlight your code, and click on the # sign. Now you code will look right, and be easier to read and understand.

    What errors are you getting from your compiler? What warnings? All the details are important when troubleshooting a program.
    Last edited by Adak; 09-25-2010 at 09:25 PM.

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,295
    Quote Originally Posted by adroitsundar View Post
    i attached a program which did not get executed as i mentioned .please correct my program.
    No. We don't just fix it for you, we help you to figure it out on your own with a few hints.

    Are you sure you read the forum policy when joining?

    Also, please paste it inside [code][/code] tags.
    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

Similar Threads

  1. Problem Passing Structure Reference To Function
    By soj0mq3 in forum C Programming
    Replies: 9
    Last Post: 04-24-2010, 10:27 AM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. Can I use STL qsort() for sorting structure?
    By franziss in forum C++ Programming
    Replies: 14
    Last Post: 09-20-2005, 05:34 AM
  4. sorting structure members using pointers
    By robstr12 in forum C Programming
    Replies: 5
    Last Post: 07-25-2005, 05:50 PM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 09:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21