i am a beginner is C++. i am reading this book C++ PROGRAMMING FUNDAMENTAL.
In chapter 4 about the header files
i have writen the HEADER FILE
but when a put it in the C++ code
and compile it says:
Error 1 fatal error C1083: Cannot open include
file: 'test.h': No such file or directory c:\documents and settings\quim costa\my documents\visual studio 2005\projects\c++ programming fundamentals\c++ programming fundamentals\chapter 4.cpp 7
this is the HEADER FILE:
CODE
//prototypes
float cube_number(float num);
int cube_number(int num);
CODE
include <iostream>
using namespace std;
//function prototype
#include <test.h>
int main()
{
float number,
number4;
cout << "Please enter a number to be cubed: ";
cin >> number;
number4 = cube_number(number);
cout << number << " cubed is " << number4 <<endl;
return 0;
}
int cube_number(int num)
{
int answer;
answer = num * num * num;
return answer;
}
float cube_number(float num)
{
float answer;
answer = num * num * num;
return answer;
}
This post has been edited by quim: 15 Dec, 2005 - 04:54 PM