your prototypes need to match the function declarations here is what i would try
double adding(double a, double b);
or
double adding(double,double);
for the proto type
double...
Type: Posts; User: rippascal
your prototypes need to match the function declarations here is what i would try
double adding(double a, double b);
or
double adding(double,double);
for the proto type
double...
I have the program working. It doesnt work when I use the extension .h but if i use the extension .cpp and change #ifndef and #define their is no problem. compare this code with that of my previous...
I haven't learned about the built in stack class and prefer to step along with the book. By doing so I learn more about implementing a stack class.
Could someone help me debug this. I am stumped.
// Stack of customers prblm 3 pg 417 c++ primer plus
#ifndef _STACKH_H_
#define _STACKH_H_
struct customer
{
char fullname[35];
Yes that would be much easier it seems. I just thought I would leave the original structure intact in order to learn how to use the structure in the class. I'm book taught and the book hasn't...
Hi,
I'm converting this golf program into a prog using a class. I want to use the old structure in the class but am not sure how to use the structure or functions of the class. Here is what I...
It's amazing how other people can spot your errors. So I assume if you set a default in the prototype you can not override this as I tryed to do. Thanks for all your help!!!
I have several questions:
<hat are the header file extensions for a c++ program using the borland compiler and the the compiler included with Dev-C++ ?
What is a project in Dev-C++? Is it simply a...
I decided to simplify things by including everything in one file for now. I have one last error in the program i con-t figure out.
//bank account prblm #1 c++ primer plus
#include <iostream>
...
I am attempting to compile this file but do not understand even the first error. This is my first attempt at using a class in c++
//bank account prblm #1 c++ primer plus
#include <iostream>...
thanks
I noticed you didn't use the keyword private in your class declaration. Is this the default then?
What does it mean to have void as the parameter for the prototype of a member function ie
void set(void);
I found the answer myself.
right click on my computer
choose properties
select the advance tab
click on environmental variables
select path from the system variables list
click edit
create a function that uses the distance formula
distance = sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-f1)))
I think this is correct.
How do I set the default path in windows xp?
I belive the problem lies with the function type not with the passing by refrence t &a. t should resolve to int or double array, but the return type may not resolve to an int or double value....
here are the errors i get using the code
#include <iostream>
using namespace std;
// template , prototypes
template <typename t>
t max5(t ar[5]);
I think you are right conceptouallyw but neither way worked using cin or !cin hence my use of strlen
To all those who have responded to my posts thank you. Have no fear I am not taking a course in c++ rather I am learning on my own with all your help and the book c++ primer plus.
I get a whole new set of errors replacing &t with ar[5]
C:\Borland\BCC55\src>bcc32 temp.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
temp.cpp:
Error E2094 temp.cpp 19:...
Need some help with this template example
on the prototype to the function I used the generic type from the template declaration t. Is this valid. C++ Primer Plus only used void as the return...
It will not compile as golf.h because it assumes the header file is a c file rather than a c++ file. There is prbly a special extension for c++ headers but cpp worked fine.
According to c++...
Here is the main file
#include <iostream>
#include "golfh.cpp"
using namespace std;
int main()
Here is the header file with the struct and prototypes
//golff.h for 8.3 pg 369 c++ primer plus
const int Len=40;
struct golf
{
char fullname[Len];
int handicap;
};
C:\Borland\BCC55\src>bcc32 golfh.cpp golfm.cpp golff.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
golfh.cpp:
golfm.cpp:
golff.cpp:
Error E2277 golff.cpp 25: Lvalue required...