CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010

    any ideas how to write this function?

    I need to write a function named:

    int getNumAccidents()

    the function is passed the names of a region within a city (north, south, east, west) The function also asks the user for the number of car accidents in that region, then returns that number. The function will be called once for each region.

    I cannot figure out how to do this without using a void function. Because I have to ask the user to input an accident figure, it runs the cout statement asking for the numAccidents when I just want to return the figure, not run the whole content of the function.

    anyone have some ideas?

  2. #2
    Join Date
    Feb 2010

    Re: any ideas how to write this function?

    nevermind im on to something.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.