Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Databases and Arrays

Posted on 2003-03-14
6
Medium Priority
?
204 Views
Last Modified: 2010-04-01
i have ...
int temp[9]

void running(int temp[])

void main()
{
  cout<<"blah"<<endl;
  running(temp[]);
}

void running(int temp[])
{
  cout<<"blah again"<<endl;
}

and it has an error saying that there are too few arguements at line 2 or whatever.

and is there a way to link a database to my program if so how? I am using Visual Studio or is there a better program?
0
Comment
Question by:philsim
6 Comments
 
LVL 2

Expert Comment

by:DarthNemesis
ID: 8141687
You're missing some semicolons, one after temp[9] and one after your function prototype void running(int temp[]).
0
 

Accepted Solution

by:
violent1 earned 200 total points
ID: 8141720
it works fine on my end, with some very minor modifications.

as the previous poster stated, you need to put the semicolons after:

int temp[9];  //inserted simcolon

void running(int temp[]);  //ditto

now, after that i only did one more thing.  temp is an array.  your program knows this.  when passing the array as an argument, you don't need to include the "[]"

so, in your main instead of putting:
running(temp[]);

you should just have:
running(temp);

after i did that, i recieved no errors/warnings and it ran fine displaying:

blah
blah again

i am using visual c++ 6.0 enterprise
0
 
LVL 4

Expert Comment

by:n_fortynine
ID: 8142445
running(temp) not temp[]
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Expert Comment

by:n_fortynine
ID: 8142449
when called functions are passed in names of args, not the prototype of args.
0
 
LVL 1

Expert Comment

by:TrueIdiot
ID: 8143429
what kind of database do you mean?
0
 

Author Comment

by:philsim
ID: 8144125
thanks very much the sample code was just a sample not my real program but when i called the sub program i did include the []
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question