Thread: How to pass a structure member to a function?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2009
    Location
    Bangalore,India
    Posts
    29

    How to pass a structure member to a function?

    Code:
    struct msg_rsp
    {
      int count;
      struct info *info_entry;
    };
    
    void func()
    {
      struct msg_rsp *resp;
      
      for (int i = 0; i < resp->count;  i++)
        {
         // How to pass resp->info_entry here to the function func( ) & increment pointer?
          func ();  
        }
    
    }
    
    void func (struct info *entry)
    {
      ..
      ..
    }
    How to pass argument properly to func () and increment the pointer to next ?
    Last edited by krishnampkkm; 11-26-2020 at 10:01 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 08-04-2017, 07:42 AM
  2. Replies: 3
    Last Post: 10-31-2013, 09:44 AM
  3. Replies: 1
    Last Post: 11-30-2012, 07:18 AM
  4. How to pass member functions into a function object...
    By TeenWolf in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2007, 01:01 PM

Tags for this Thread