473,387 Members | 3,821 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,387 software developers and data experts.

M:\lineX\lineX.cpp(38) : error C2447: missing function header (old-style formal list?

1
//----------------------------------------------------------------
//This program will find the length of a line on a plane. With the
//one end at the origin and the other end selected by the user and
//print it to screen.

# include <math.h>
# include <stdlib.h>
# include <iomanip.h>
# include <iostream.h>

int main()
{

//Define constants, variables, and prototypes.
double length(double x, double y);
double x_in,y_in;


//Have user enter values for x and y.
cout << " Enter in the values for x and y. " <<endl;
cout << " Enter x value." <<endl;
cin >> x_in;
cout << " Enter y value." <<endl;
cin >> y_in;

//Print anwser to screen.
cout << "The length of the line is equal to " << length <<"."<<endl;

//Exit program.
return 0;

}

//-----------------------------------------------------------------
//This function evaluates the length of the line.
//
double length(double x, double y);
*{


sqrt(pow(x_in,2)+pow(y-in,2));
return length;
}

//-----------------------------------------------------------------

The astric is where the program has the error. What is wrong?
Sep 27 '06 #1
1 3780
D_C
293 100+
Expand|Select|Wrap|Line Numbers
  1. double length(double x, double y);
  2. *{
should be
Expand|Select|Wrap|Line Numbers
  1. double length(double x, double y)
  2. {
Also
Expand|Select|Wrap|Line Numbers
  1.   cout << "The length of the line is equal to " << length <<"."<<endl;
should be
Expand|Select|Wrap|Line Numbers
  1.   cout << "The length of the line is equal to " << length(x_in,y_in) <<"."<<endl;
Sep 27 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Suzanne | last post by:
Hi++, I get a link error when I try to call a template function that is declared in a header file and defined in a non-header file. I do *not* get this link error if I define the template...
1
by: stanlo | last post by:
hello to all please can you please help me i am doing my project mathem<athecal expression and i have an error i cannot interprete it is ,,missing function header,, i tried to see if there is...
7
by: | last post by:
How to call a function with variable argument list from another function again with variable argument list? Example : double average ( int num, ... ); double AFunct1 ( int num, ... ); double...
3
by: Cliff Cooley | last post by:
I'm trying to compile a VC++7 application from code loaded from a VC++6 project, but I keep getting the following compiler warning -> c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7...
2
by: singhs21 | last post by:
hello can anyone help me im making a project ive been for hours on sites looking for help: basically, im making site which reads a password, allows access if it is correct: it will also after 3...
2
by: im2cre8iv | last post by:
Here is my code where I am receiving the error: #include <fstream> #include "BinaryTree.h" using namespace std; Node* BinaryTree::MakeTree(ifstream& infile) { char name; infile>>name;
3
by: cardoow | last post by:
Hi this is my code : HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) { ...
12
by: slizorn | last post by:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int err how do i fix that error? for example given to this section of code.. Matrix::addMatrix(Matrix m1,...
1
by: Alberto Menchen | last post by:
Hi, I'm Alberto. I am trying to compile a program but I have an error that I don't know to solve. This program was built some years ago. Two mains problems, I think is in: doc/Makefile.am:24:...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.