?
Solved

Databases and Arrays

Posted on 2003-03-14
6
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

770 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