Thread: Copying code with line numbers

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    3

    Cool Copying code with line numbers

    I have seen code with the line numbers scattered throughout the forum. I tried to copy in my editor but I do not get line numbers when I do this.... so simple question... how do you do it? Trying to be prepared for when I have a question concerning code....

    I am using Microsoft Visual C++ 2010 express.


    Thanks much.

    Michael

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Why do you need line numbers in the editor ? (It won't compile with the line numbers.)

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    3
    The line numbers are put in there by the editor. I checked the box to have them in. That way when it gives me an error with a line number I can find it easily.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Click the button above the code that says "To plain text"?

    EDIT: Oh, you want it *with* line numbers...never mind. But you don't seem to understand...your *compiler* will tell you the line numbers when there's an error.

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    3
    Here is what I am trying to do. When someone has a problem in code they are copying code here in the forum with line numbers. It looks like just like what I have in my editor in Express 2010. I am trying to figure out how they copied the code from their editor to the forum with the line numbers so when I have a problem in my code I can do the same thing.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    the forum automatically adds the line numbers when it formats the code wrapped in code tags.

  7. #7
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Please don't add stuff to your code that isn't code.

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extra line break added during copying
    By Tigers! in forum C Programming
    Replies: 14
    Last Post: 10-21-2009, 04:49 AM
  2. detecting numbers in a code of line
    By aama100 in forum C++ Programming
    Replies: 7
    Last Post: 01-23-2008, 10:24 AM
  3. Imposing Line Numbers automatically in the C code
    By cavestine in forum C Programming
    Replies: 14
    Last Post: 10-15-2007, 12:41 AM
  4. Line numbers
    By cdn_bacon in forum Tech Board
    Replies: 3
    Last Post: 04-28-2007, 04:58 PM
  5. line numbers?
    By anomaly in forum Tech Board
    Replies: 5
    Last Post: 12-11-2003, 01:24 PM