Thread: structure problem

  1. #1
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162

    structure problem

    Structure-valued functions are usually implemented by adding a hidden return pointer...

    plz comments..if possible by a small example

  2. #2
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    I detect the sweet stench of homework...

  3. #3
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162
    Quote Originally Posted by cwr
    I detect the sweet stench of homework...
    U need to upgrade your detection skills....i was reading comp.lang.c FAQ's.....and came across this line...which i couldn't understood...

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Perhaps you should improve what you post then, citing where you saw a particular article (or whatever) then asking for clarification.

    Code:
    struct foo { int a;  char b[10]; };
    
    struct foo aFunction ( void ) {
      struct foo result = { 0 };
      return result;
    }
    It's basically addressing how you return a whole structure. It's something you don't need to worry about unless you're actually writing a compiler.
    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. problem getting structure to work in my function
    By Tom Bombadil in forum C Programming
    Replies: 18
    Last Post: 05-28-2009, 09:53 AM
  2. Problem with structure and class
    By Bargi in forum C++ Programming
    Replies: 3
    Last Post: 09-25-2007, 02:30 AM
  3. Problem with arrays inside a structure
    By babu in forum C Programming
    Replies: 4
    Last Post: 07-12-2007, 09:35 AM
  4. accessing structure pointer problem
    By godhand in forum C Programming
    Replies: 2
    Last Post: 04-09-2004, 10:52 PM
  5. Problem checking for numeric value in a structure
    By ronkane in forum C++ Programming
    Replies: 4
    Last Post: 01-20-2002, 02:53 PM