Thread: help please..alphabetic sorting.

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    So now that you've fixed that, how's the size? How are you checking when you say it prints out the wrong number? Make a file with:
    Save it. Load it. What's your answer? Do you have a newline after the 5? Try it with and without. Note the 'size'. Just make a file that does only that. Open, count the newlines, close, print the size.

    Hope is the first step on the road to disappointment.

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > lines I had a "incompatible types in assignment" error so I add the "*"'s.
    Yeah, my mistake

    You would need char **a to make swapping pointers possible. (*a)[50] are still arrays, so you still have to use the strcpy() approach you had previously.

    I can't see anything wrong with your line counter, apart the the already mentioned =100
    Try debugging with really small files (like one or two lines) and see what results you get.

    Beware that lots of trailing blank lines will likely make your code fail in it's present form.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with linked list sorting function
    By Jaggid1x in forum C Programming
    Replies: 6
    Last Post: 06-02-2009, 02:14 AM
  2. Sorting Algorithm Help
    By cjwenigma in forum C++ Programming
    Replies: 8
    Last Post: 11-02-2007, 02:04 PM
  3. sorting structure members using pointers
    By robstr12 in forum C Programming
    Replies: 5
    Last Post: 07-25-2005, 05:50 PM
  4. Replies: 2
    Last Post: 02-23-2004, 06:34 AM
  5. Still Needing Help : selection sorting
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 10-14-2001, 08:41 PM