Thread: Question of the day

  1. #1
    casino_king
    Guest

    Question of the day

    What the advantage of forward declaration?

    For example:
    In header_file.h

    typedef struct foo * fooPtr;

    In implement_file.c
    Code:
      struct foo
        {
           int x;
           int y;
        }
    [code tags added by ygfperson]

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    it helps with type checking most of the time. it's unlikely you'll make the same mistake twice in one program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  2. day of week
    By s_ny33 in forum C Programming
    Replies: 18
    Last Post: 11-02-2005, 11:56 AM
  3. Should I learn a FULL language first?
    By Raeliean in forum Game Programming
    Replies: 8
    Last Post: 07-16-2005, 06:59 PM
  4. stupid question of the day
    By davidnj732 in forum C++ Programming
    Replies: 2
    Last Post: 02-17-2003, 02:46 AM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM