Thread: function call

  1. #1
    Registered User CASHOUT's Avatar
    Join Date
    Jul 2011
    Location
    Florida
    Posts
    88

    function call

    What would be the correct way to call a function within main that has file pointer parameters?

    function prototype:
    Code:
    void CalculateBoth(int num1, int num2, int*sumPtr, int *diffPtr);

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by CASHOUT View Post
    What would be the correct way to call a function within main that has file pointer parameters?

    function prototype:
    Code:
    void CalculateBoth(int num1, int num2, int*sumPtr, int *diffPtr);
    Untested code below.
    Code:
    {
    
       int sum, diff;
       int num1, int num2, int*sumPtr, int *diffPtr;
    
       sumPtr = ∑
       diffPtr = &diff;
    
       CalculateBoth(num1, num2, sumPtr, diffPtr);
    }
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User CASHOUT's Avatar
    Join Date
    Jul 2011
    Location
    Florida
    Posts
    88
    Quote Originally Posted by stahta01 View Post
    Untested code below.
    Code:
    {
    
       int sum, diff;
       int num1, int num2, int*sumPtr, int *diffPtr;
    
       sumPtr = ∑
       diffPtr = &diff;
    
       CalculateBoth(num1, num2, sumPtr, diffPtr);
    }
    Tim S.
    Thank you Tim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-22-2011, 09:59 PM
  2. Replies: 8
    Last Post: 07-08-2011, 01:16 PM
  3. Replies: 5
    Last Post: 10-17-2006, 08:54 AM
  4. Replies: 2
    Last Post: 06-21-2005, 02:41 PM
  5. function call for a average function
    By ricekingg in forum C++ Programming
    Replies: 1
    Last Post: 02-04-2002, 02:16 PM