CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

Functions that return two values topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2008, 03:00 AM
Junior Member
 
Join Date: Dec 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
psppb is on a distinguished road
| More
Functions that return two values

Hello all. I have a function that is trying to return an array (overcoat) and a variable 'money' The program is quite large and is and old computer game called "Dopewars" Someone wrote it for the old graphing calculators back when I was in High School.

in the program Money is a global variable and so is overcoat because they change everyday. the '&' ampersand just does not seem to do the trick. am I overloading it incorrectly?

here's the code. The jist is that you have thirty days to make as much cash as possible in the "Street Pharmacy" business.

once again I apologize if this offends anyone but it was a silly game and I am just trying to see if my skills have come along well enough to write it on my own.
dopewars.txt




the errors are

68 C:\Documents and Settings\Bill\My Documents\dopewarsrevised.cpp expected primary-expression before "int"
Reply With Quote
  #2  
Old 01-22-2008, 11:08 PM
Junior Member
 
Join Date: Dec 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
psppb is on a distinguished road
| More
Re: Functions that return two values

Update. I cleaned the code up to eliminate the problem of two returns but I still have the most nagging of problems that I cannot seem to figure out. The array is a double

here is the program... Please help

Thanksdopewars.txt
Reply With Quote
  #3  
Old 02-12-2008, 10:11 PM
Junior Member
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
kslpeter87 is on a distinguished road
| More
Re: Functions that return two values

1. your 'drugbuy' function expect to receive an array. But the argument you send from the main is an array subscript notation, which is a content of the array.

i can run it when i solve this prob.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to return the date a week ago from today Rocket452 C# Programming 3 01-23-2009 05:16 AM
Virtual Functions and pointers Spogliani C++ Programming 1 07-15-2008 01:58 AM
collect unicode values using C++ code and ODBC calls ketu0001 C++ Programming 0 05-23-2007 04:13 AM
Beginners Question on 'return' MartijnMulder C# Programming 1 12-08-2006 02:33 PM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:11 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board