Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 131,692 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,481 people online right now. Registration is fast and FREE... Join Now!




please help me with this <test.h>

 
Reply to this topicStart new topic

please help me with this <test.h>

quim
post 15 Dec, 2005 - 04:48 PM
Post #1


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


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
User is offlineProfile CardPM

Go to the top of the page


Videege
post 15 Dec, 2005 - 05:15 PM
Post #2


rêvant.toujours

Group Icon
Joined: 25 Mar, 2003
Posts: 1,404



Dream Kudos: 150
My Contributions


When you include your own custom header files (i.e., not ones in the standard library), include them in this manner:

#include "whatever.h" //notice the quotes and not <>

make sure the whatever.h is in the same directory as your executable.
User is offlineProfile CardPM

Go to the top of the page

quim
post 15 Dec, 2005 - 05:39 PM
Post #3


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


QUOTE(Videege @ 15 Dec, 2005 - 07:12 PM)
When you include your own custom header files (i.e., not ones in the standard library), include them in this manner:

#include "whatever.h" //notice the quotes and not <>

make sure the whatever.h is in the same directory as your executable.

thanks Videege
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/20/08 08:22AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month