classify number-to file not screen

This is a discussion on classify number-to file not screen within the C++ Programming forums, part of the General Programming Boards category; Why have you started a new topic asking the same question? Also: Originally Posted by me Also one of your ...

  1. #16
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Why have you started a new topic asking the same question?

    Also:
    Quote Originally Posted by me
    Also one of your functions differs from the prototype:
    Code:
    void calcSum( int zeros, int evens, int odds);
    
    int calcSum( int zeroCount, int oddCount, int evenCount)
    {
    calcuSum =(zeroCount + oddCount + evenCount);
    }
    In C++ you dont need to name the variables in your prototype, so you can declare your prototype like:
    Code:
    int calcSum(int, int, int);
    I changed your function from void to int as it looks like you want to be returning a total here.Your function should then look something like:
    Code:
    int calcSum( int zeroCount, int oddCount, int evenCount)
    {
        return zeroCount + oddCount + evenCount;
    }
    With those changes I am now getting error messages: undefined references to getNumber , and writeNumber. I'll look into that later if no-one else here helps out first.
    I'm starting to get the impression that this is just a wind up...

  2. #17
    Registered User
    Join Date
    Jun 2007
    Posts
    61
    what do you mean wind up? when you say changed my code it allows you to change my code or you have just shown the chagnes? I am so new at this--originally we had to write the program to have input/output on the screen than he said change it to have input/ouput to file and add code to sum and avg the numbers. I did not know how to just change things-maybe I should have started all over again. Thanks for your help mike_g. I greatly appreciate it. I beginning to think I did the sum wrong becaue I was summing the number of odds evens and zeros and not the numbers themselves--I will try to figure this out and have you check to see if I have done that part right--let me know about the code changes or do I type what you have--it is just all confusing to me know--...trying to learn as much as I can about C++

  3. #18
    Registered User
    Join Date
    Jun 2007
    Posts
    61
    oh yeah by the way this course is an internet course via local college and there is no one to ask--also, initially this was not an assignment than a chapter later it is one

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 05:27 PM
  2. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 02:19 PM
  3. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  4. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM

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