Thread: Calling of function within a structure

  1. #1
    Registered User
    Join Date
    Apr 2008
    Location
    New Delhi,India
    Posts
    17

    Calling of function within a structure

    Could anybody tell me how to call a function with in a structure.

    Will it compile????

    Pls give one example.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    No it won't.

    You can have a pointer TO a function inside a structure, but it won't call it for you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C interview questions
    By natrajdreams in forum C Programming
    Replies: 7
    Last Post: 12-12-2010, 12:40 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM
  4. 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
  5. Passing a structure to a function?
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 12-03-2001, 04:28 AM