Accessing other functions at command prompt (stuck in the book AC++)

T

tony_jeffs

I understand the sections of code in the latter part Ch 4, and am
close to understanding the whole thing, but I'm stuck with an aspect
of having all these files and functions work together.

The program's purpose is to collect student grades from input, (int,
mid, final, and homework grades - a Struct is designed for he purpose)
All the grades are stored in a vector, the students are alpabetised,
and the overall grade is calculated for each student.

I have it all compiled, but when I run it, understandably, all I get
is a prompt.
I think I need to run the function Student_info first off, which will
read and process my data.

What do I type to run a function other than main at the command
prompt?


Thanks
Thanks
Thanks

Tony
 
L

LaxTransplant

When running an application from the command prompt only the main
function with be called directly. However, you can call other methods
that are defined from your main method. For example:

int
SquareRoot (
int pNumber)
{
return pNumber * pNumber;
}

int main ()
{
int x = 10;
int result = 0;

result = SquareRoot (x);

return 0;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,665
Latest member
salkete

Latest Threads

Top