what is #line

This is a discussion on what is #line within the C++ Programming forums, part of the General Programming Boards category; i want to know more about #line in cpp. is it is a preprocessor..?what action it will do...?...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    1

    what is #line

    i want to know more about #line in cpp. is it is a preprocessor..?what action it will do...?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    It's a preprocessor/compiler instruction that tells the compiler what line it is on, overriding its internal count. It's used mostly by tools that generate C or C++ code, such as lex and yacc, so that error messages from the compiler relate back to the original source file, not the generated code.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to do encryption in C
    By sankarv in forum C Programming
    Replies: 33
    Last Post: 12-28-2010, 10:01 AM
  2. Reading a file line by line
    By Raskalnikov in forum C Programming
    Replies: 8
    Last Post: 03-18-2009, 11:44 PM
  3. Pointer and Polymorphism help.
    By Skyy in forum C++ Programming
    Replies: 29
    Last Post: 12-18-2008, 08:17 PM
  4. Printing Length of Input and the Limited Input
    By dnguyen1022 in forum C Programming
    Replies: 33
    Last Post: 11-29-2008, 03:13 PM
  5. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 05:44 PM

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