help with external structure

This is a discussion on help with external structure within the C++ Programming forums, part of the General Programming Boards category; so I have main.cpp x.cpp x.h y.h and y.cpp files. in my x.h, I #include "y.h" at the start and ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    51

    help with external structure

    so I have main.cpp x.cpp x.h y.h and y.cpp files.

    in my x.h, I #include "y.h" at the start and declare my struct List.
    Inside my struct, there are some functions.


    in my y.h header file, I have another struct Line with one function.


    The functions in my x.h files are implemented in my x.cpp file.

    in one of the function, I want to call a function in my y.h file.
    Can someone please tell me how can I call that function please.


    Nvm, I figured that out. I need to include a struct in my x.cpp file
    Last edited by byebyebyezzz; 06-10-2011 at 05:19 PM.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,423
    Separate the implementations to your .cpp files and include appropriate header files in the source files to get access to the declarations.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 04-25-2010, 10:57 AM
  2. Automatic variables in external structure definition
    By Boxknife in forum C Programming
    Replies: 2
    Last Post: 06-23-2008, 12:56 PM
  3. external structure declaration
    By aze in forum C Programming
    Replies: 5
    Last Post: 04-16-2004, 04:27 PM
  4. Keeping track of static external structure
    By pwilfred in forum C Programming
    Replies: 6
    Last Post: 03-13-2003, 05:23 PM
  5. External structure?
    By mart_man00 in forum C Programming
    Replies: 3
    Last Post: 09-08-2002, 07:42 PM

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