structure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krithikanarendran
    New Member
    • Feb 2008
    • 2

    structure

    hi
    it is possible to call finction with in structure in 'C' language
    like
    [code=c]
    struct parent
    {
    int id;
    void mark();
    }s;
    mark()
    {
    int m1,m2
    }
    [/code]
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    You cant durectly have a structure inside a C structure.
    Instead of that declare a function pointer as a member inside the structure and you can call the function using the function pointer

    Raghuram

    Comment

    • Arulmurugan
      New Member
      • Jan 2008
      • 90

      #3
      Originally posted by krithikanarendr an
      hi
      it is possible to call finction with in structure in 'C' language
      like
      [code=c]
      struct parent
      {
      int id;
      void mark();
      }s;
      mark()
      {
      int m1,m2
      }
      [/code]
      No you can not call function inside struct declaration.

      Comment

      Working...