structures

This is a discussion on structures within the C++ Programming forums, part of the General Programming Boards category; I'm trying to write a C program using GCC with four different moduals. e.g. 1.cpp, 1.h, 2.cpp, 2.h etc. I ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    18

    Question structures

    I'm trying to write a C program using GCC with four different moduals. e.g. 1.cpp, 1.h, 2.cpp, 2.h etc. I would like to build a structure that
    all moduals can use. I have a structure in 1.h
    and can use it in 1.cpp but I can't seem to pass the structure to functions in the other files without error. The all functions need to use the same variables.

    Thanks in advance



  2. #2
    Nagesh
    Guest

    Solution for .........

    Hi
    Please make the struct var. extern where you want to use.Please try it out using this..........
    Hope so it will solve your problem.
    Regards
    Nagesh

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    6
    make sure you have "i.h" #include-d in your "2.cpp"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  2. Structures, passing array of structures to function
    By saahmed in forum C Programming
    Replies: 10
    Last Post: 04-05-2006, 11:06 PM
  3. Input output with structures
    By barim in forum C Programming
    Replies: 10
    Last Post: 04-27-2004, 08:00 PM
  4. pointers to arrays of structures
    By terryrmcgowan in forum C Programming
    Replies: 1
    Last Post: 06-25-2003, 09:04 AM
  5. Methods for Sorting Structures by Element...
    By Sebastiani in forum C Programming
    Replies: 9
    Last Post: 09-14-2001, 12:59 PM

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