Thread: Spacing issue...(diff command)

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    158

    Spacing issue...(diff command)

    Spacing issue...

    So with the diff command i'm seeing weird results

    These two phrases are literally stacked on top of each other. Word for word and yet diff considers them different.

    "as a percentage of the course grade>"
    "as a percentage of the course grade>"

    I don't there is a line break issue? extra spaces anywhere in the program?

    What gives?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Maybe the line endings are different.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2012
    Posts
    158
    Well that sucks since my instructor's .out file is private i have no way to see whats different.

  4. #4
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Maybe one has a '\n' at the start of end of it and the other doesn't
    Fact - Beethoven wrote his first symphony in C

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Ask your instructor for help.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Quote Originally Posted by tmac619619 View Post
    Well that sucks since my instructor's .out file is private i have no way to see whats different.
    Maybe you do -> Make a little program to print out the ASCII value of each character

    i.e.
    Hello world =
    [0x48][0x65][0x6C]...
    Fact - Beethoven wrote his first symphony in C

  7. #7
    Registered User
    Join Date
    Oct 2012
    Posts
    158
    If only i knew how my instructor positioned his \n.

    It sucks that diff command is useless in this situation, it doesn't even help.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Nothing to do with C, moved to tech.
    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. A question about Linux's "diff" command
    By meili100 in forum Tech Board
    Replies: 4
    Last Post: 09-17-2008, 02:35 AM
  2. Can I issue a command to DOS from within a program?
    By Sukarn in forum Windows Programming
    Replies: 2
    Last Post: 12-22-2006, 07:44 AM
  3. why does this code do something diff on 2 diff boxes?
    By crypto_quixote in forum C Programming
    Replies: 3
    Last Post: 03-08-2005, 12:11 PM
  4. Spacing?
    By trenzterra in forum C++ Programming
    Replies: 5
    Last Post: 11-28-2002, 10:42 PM
  5. Diff compiler == diff program????
    By Imperito in forum C++ Programming
    Replies: 21
    Last Post: 04-25-2002, 12:50 PM