Need help wrinting program that uses functions to compute various math values

Discussion in 'Homework Help' started by HCN1996, Apr 9, 2016.

Thread Status:
Not open for further replies.
  1. HCN1996

    Thread Starter New Member

    Nov 29, 2015
    26
    0
    View attachment 104082 View attachment 104073 View attachment 104075 Im a little confused as to what my teacher means when she says that my main cannot process anything. Does that mean that I cannot do if statements or loops in my main? Im not sure how to set up my functions because main has to be the one that opens the file. How do I access the file in other functions? Thanks for your time.

    Moderators note: It is NOT NICE to remove the text and images, as it will make the thread useless for further reference.
     
    Last edited by a moderator: Apr 10, 2016
  2. DGElder

    Member

    Apr 3, 2016
    344
    85
    It's been a long time since I did any programing in C, but don't your functions and main() need to be enclosed in brackets?
     
  3. DGElder

    Member

    Apr 3, 2016
    344
    85
    and I see no variable type definitions, for example...

    int add(a, b)
    int a;
    int b;
    {
    return a + b;
    }
     
Loading...
Thread Status:
Not open for further replies.