Thread: passing static structures members to function

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    18

    passing static structures members to function

    hi every body!

    I am trap in a problem regarding structure.

    I have declare a structure as follow:

    Code:
    A.h
    // this is the structure in which I have declare
    typedef struct 
    {
            static char name[0x100];
    	static char address[0x100];
    	static char employer[0x100];
    
    }TExternalFilter;
    
    AAAAAA(TExternalFilter* ExternalFilter);
     
    //I have to pass the values of these members to a function whose prototype is:
    
    A.cpp
    
    AAAAAA(TExternalFilter* ExternalFilter)
    {
      char temp[256];
    
    strcpy(temp,ExternalFilter->name);//so on
     
    cout<<temp; //no output
    }
    
    main.cpp //from which values are send
    
    TExternalFilter ExternalFilter={"aaaa","bbbb","ccccc"};
    
    AAAAAA(&ExternalFilter);
    
    
    //I am doing following but i am not able to fetch these values.
    //Or in other words the values transfered are not visible in main program
    
    //How can I do that
    I want to clear that the structure declaration and function prototype can't be changed.There is no error in program.

    I have to kept member as static.

    What we can do is that we can only change the "main.cpp" program and no modification in A.h and A.cpp

    Actually these two are DLL files and I have no permission to change DLL files only I change is main.cpp.

    I am using VC++ 6.0 compiler.

    Please keep this in mind and reply me soon.

    Thanks
    Bhagwat
    Last edited by bhagwat_maimt; 11-17-2006 at 04:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with Free.
    By chakra in forum C Programming
    Replies: 9
    Last Post: 12-15-2008, 11:20 AM
  2. Passing a byte and its bits to a function
    By rtarbell in forum C Programming
    Replies: 9
    Last Post: 12-04-2008, 09:24 AM
  3. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM