473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Jul 23 '05 #1
1 1335
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;
}

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
16
by: Harry Meier | last post by:
Just found it on the web by searching for significant parts of the book-text with google; use the following as a filelist for wget (wget -i filelistname): ...
6
by: Zeng | last post by:
Hello, I'm using C# .NET. Is there a way to do a build my project and solution with command prompt? I hope that while it's doing that, at least I can browse around the code instead of being...
7
by: k8 | last post by:
Hello- I'm stuck on a Windows machine today and would love to fully play with and test a simple python script. I want to be able to type "python myscript myarg" somewhere. Is there anything...
1
by: C. Adam Barney | last post by:
I would like to create my own command prompt application using .NET. I'm looking to start off with a basic framework, essentially passing commands through to cmd and displaying the results. ...
6
by: Jwolf | last post by:
I have .net 2002 edu version and when it installed there was a shortcut to the .net command prompt. My CLR disk is scratched so I can't reinstall and so I just downloaded express. I dont know...
1
by: uk2theusa | last post by:
First of hi to everybody as I'm new here ; ) I have just installed Active Perl 5.8 to my computer running on Windows XP, easy : ) I have my book Perl for Dummies 4th Edition as I am just...
10
by: strife | last post by:
Hey everyone, I was making a program for a class, and I ran into a problem that is driving me crazy. I first suspected Vista, and since I am not home I cannot verify if it just my Vista...
5
by: waltbrad | last post by:
Hi folks. I'm learning Python from the Mark Lutz Book, Programming Python 3rd edition. He seems to be able to invoke the Python interpreter from any command line prompt. C:\temp>python ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.