Thread: C++ has an output maximum of 80 chars per line?

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    4

    C++ has an output maximum of 80 chars per line?

    I'd like to output more than 80 characters per line into a txt-file. Is this possible?

    Cheers,

  2. #2
    Registered User Sake's Avatar
    Join Date
    Jan 2005
    Posts
    89
    Of course it's possible. If your compiler only allows 80 characters in a line (whatever a line is) then you can write multiple lines to the file without writing a newline character. Where are you getting that 80 character limit?
    Kampai!

  3. #3
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Perhaps the software you are using to view your files wraps at 80 lines, but there will be no line break unless you put one there.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    4
    Indeed, my browser wrapped it up, using another browser give no maximum at all.

    Thnx for helping me out!

  5. #5
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    its always good to keep your output at 80 chars per line - it is not a rule set in stone, but most books and written documents have between 80-85 chars per line.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by axon
    its always good to keep your output at 80 chars per line - it is not a rule set in stone, but most books and written documents have between 80-85 chars per line.
    I have to agree here... the only time I would go over 80 characters is if it were some special application (ASCII image/graph etc.) and can print landscape, or if you're writing to a data file that never has to be/can be read by a human.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Ehh... Really, I'd say you guys are pulling a bit too hard for that rule. If it actually is meant for someone to read/look at through say a text editor or browser, then follow that rule. Otherwise, don't bother (it can be more of a pain to deal with). Anyway, this is just personal opinion.

    *edit*
    Actually, I take back what I said. I think it is much better to let the autowrap feature of whatever the user is attempting to view the file with handle that particular formatting. Not everyone's configuration will permit exactly the same length line, so you will get very puzzling and distracting line-breaks if you format it and an auto-wrap happens to be on.

    Cheers
    Last edited by Zach L.; 01-31-2005 at 09:43 PM.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  8. #8
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by Zach L.
    Ehh... Really, I'd say you guys are pulling a bit too hard for that rule. If it actually is meant for someone to read/look at through say a text editor or browser, then follow that rule. Otherwise, don't bother (it can be more of a pain to deal with). Anyway, this is just personal opinion.

    Cheers
    well think about it this way: when somebody (probably a n00b) tells you they're having problems reading stats in from their data file, and they give you this as their file:
    Code:
    287:184,orage'1487"78?288:187,blue'1872"23?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  9. #9
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    A small sample such as the one you showed, I wouldn't mind. Granted, one should be careful to make things at least somewhat reasonable until s/he is skilled enough to be able to figure out what is going on with more cryptic data formats. I see no problem with what you posted, though.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  10. #10
    Registered User dug's Avatar
    Join Date
    Jun 2003
    Posts
    66
    i think CString has a limit somewhere around the 80 character limit...
    "take the long road.... and walk it."

  11. #11
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    CString, an MFC class for string handling, has a limit at roughly 2.000.000 characters. If you happen to need more, you are in a bit of trouble anyway, as the string would consume 2 GB of RAM.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  12. #12
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Indeed. There is a difference though. If you use multiple strings to store your data, but you never include a newline character anywhere in them, then the effect of the smaller strings is completely transparent to the user.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  3. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  4. Greenhand want help!
    By leereg in forum C Programming
    Replies: 6
    Last Post: 01-29-2002, 06:04 AM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM