Variable not initialized?
<p>For a homework problem I have to define a struct that can be used in a program to represent a fraction, together with a set function that can be used to set up the value of a fraction, and a print function that will print the fraction nicely. We are given the main function and according to the problem the output should be</p>

<p>(2/3) (1/5) (3/5)</p>

<p>Here's what I've written:</p>

<pre><code>#include "library.h"
struct fraction
{
    int numerator;
    int denominator;
};

void set (fraction st, int n, int d)
{
    if (d&gt;0)
    {
        n = st.numerator;
        d = st.denominator;
    }
}

void print(fraction st)
{
    int x = st.numerator;
    int y = st.denominator;
    print("(x/y)");
    print(" ");
}

void main()
{
    fraction a, b, c;
    set(a, 2, 3);
    set(b, 1, 5);
    set(c, 3, 5);
    print(a);
    print(b);
    print(c);
}
</code></pre>

<p>If you're wondering "library.h" is what my university uses as a shortcut for most of the standard includes.</p>

<p>I keep getting the error that the variable 'a' is being used without being initialized. Any help would be greatly appreciated.</p>