Question of the day

This is a discussion on Question of the day within the C Programming forums, part of the General Programming Boards category; What the advantage of forward declaration? For example: In header_file.h typedef struct foo * fooPtr; In implement_file.c Code: struct foo ...

  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,493
    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, 10: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, 01:46 AM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 02:57 PM

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