structure problem

This is a discussion on structure problem within the C Programming forums, part of the General Programming Boards category; Structure-valued functions are usually implemented by adding a hidden return pointer... plz comments..if possible by a small example...

  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
    cwr
    cwr is offline
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    868
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 01:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21