header files

This is a discussion on header files within the C Programming forums, part of the General Programming Boards category; Hello, I am usnig Windows98 and Visual studio 6.0 programming in C. The assignment that I am working on has ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    7

    Angry header files

    Hello,
    I am usnig Windows98 and Visual studio 6.0 programming in C.

    The assignment that I am working on has the requirement to use a header file that we create and include in the c code. I have created the header file in the usual way by going to file, new and then choosing c/c++ header file. The name of the file is assign12.h. When I try to include this file I get the error that it does not exist. It has been saved, along with my project. The file names are typed correctly.

    My instructor in class said that you create the file in the same manner as a standard C file. She never said that we have to do anything else.

    Many thanks to whoever can help me.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,660
    Is the header in the same directoriy as the program?

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    7
    The header file is in the same directory as the c source code.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    207
    Did you try to save it in the same folder as the rest of the headers?

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Hmm... could we see...
    1) The #include statements in your source file...
    2) The name of the header file, and
    3) The contents of the headerfile
    please?
    Callou collei we'll code the way
    Of prime numbers and pings!

  6. #6
    Unregistered
    Guest

    Smile

    Hi

    I think probably the most likely explanation is that you are trying to use a #include line like a library header :

    #include <assign12.h>

    rather than the way you need to :

    #include "assign12.h"

    the difference is that the compiler looks in a different directory for ones surrounded with < > than " ". Make sure you still use < > for any includes that were already there, you can't just replace all of them with " ".

    Hope this helps
    -Penfold

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. #include header files or .cpp files?
    By DoctorX in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2006, 11:21 AM
  3. classes and header files
    By Drake in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2006, 06:12 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21