struct

This is a discussion on struct within the C Programming forums, part of the General Programming Boards category; How do i define a struct function type as an aggregate of two doubles: a numerator and a denomenator?...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    31

    Question struct

    How do i define a struct function type as an aggregate of two doubles: a numerator and a denomenator?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    do u mean something like this....

    Code:
    struct fraction
    {
    double numerator;
    double demoninator;
    }
    
    double Agg( struct fraction* frac)
    {
    return frac->numerator + frac->denominator;
    }
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 12-03-2008, 03:10 AM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 04:25 AM
  3. Replies: 10
    Last Post: 05-19-2006, 12:23 AM
  4. What's wrong with my search program?
    By sherwi in forum C Programming
    Replies: 5
    Last Post: 04-28-2006, 10:57 AM
  5. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM

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