CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Homework Function Help.

    The compiler is right. Check your spelling carefully.

  2. #17
    Join Date
    Mar 2009
    Location
    Granada, Spain
    Posts
    40

    Re: Homework Function Help.

    You need a main function.

  3. #18
    Join Date
    Apr 2009
    Posts
    11

    Re: Homework Function Help.

    there is a main function, but i'm not in charge of that. This is a group project and my job is these 3 functions

  4. #19
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Homework Function Help.

    Quote Originally Posted by Poeticsoul44 View Post
    there is a main function, but i'm not in charge of that. This is a group project and my job is these 3 functions
    Did you follow my advice in post #16?

  5. #20
    Join Date
    Feb 2007
    Posts
    43

    Re: Homework Function Help.

    I think your teacher is trying to teach you the importance of coffee. Wake up!

    Spelling things correctly isn't always important, but spelling variables the SAME is. ;p

  6. #21
    Join Date
    Feb 2009
    Posts
    24

    Re: Homework Function Help.

    Quote Originally Posted by Poeticsoul44 View Post
    I just included "using namespace std;" and get these errors:
    1st:
    air.cpp: In function âvoid airfare(double&, double&)â:
    air.cpp:7: error: âairefareAllowedâ was not declared in this scope
    air.cpp:7: error: âairefareCostâ was not declared in this scope
    2nd:
    miles.cpp: In function âvoid milage(int, double&, double&)â:
    miles.cpp:4: error: âcoutâ was not declared in this scope
    miles.cpp:4: error: âendlâ was not declared in this scope
    miles.cpp:5: error: âcinâ was not declared in this scope
    3rd:
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
    (.text+0x20): undefined reference to `main'
    collect2: ld returned 1 exit status
    (1) Pay more attention to spelling. airefareAllowed != airfareAllowed

    (2) You can compile but you cannot link your program unless you have a function with the signature "int main () or int main (int, char**).

    (3) If you aren't responsible for main, write your own int main(void) that does some testing on your part of the code. Comment it out before you sent it to your collaborators.

    (4) New programmers should not collaborate.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured