Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Header files and Pointers

Posted on 2001-06-15
4
Medium Priority
?
187 Views
Last Modified: 2010-04-02
I am a student. This is not an assignment. Do you always have to have a header file in C++? How does the program work if you do not need a header file? I also was hoping someone could send me a good link that explains pointers and maybe linked lists.
0
Comment
Question by:awjackin35
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6195019
See:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20135953

So it seems you and sajid are taking the same class?
0
 

Author Comment

by:awjackin35
ID: 6195061
I already read the answers and sajid question. That is why I asked the question. What about iostream.h, Don't you have to have that header file? I also need a good pointers and LL Tutorial.
0
 
LVL 5

Accepted Solution

by:
garboua earned 225 total points
ID: 6195299
here is a quick and simple tutorial about LL
http://personal.adesso.com/~dkovacs/linklist.html
WElL, you need a header file to tell source code that some kind of a function exists some where and tell the compiler not to panic
you can always tell the compiler about other functions in another source file by using the "extern."  Most people don't do this because it becomes old and just too much work.  you have to remember all funcs and put them in all source code and etc etc etc.
you only need to include iostream if you are using one of its funciton, if not then you don't have to.
hope that helped.
0
 
LVL 10

Expert Comment

by:makerp
ID: 6195633
you need to include header files for the functions you want to use. for example to use cout,cin etc you need to include <iostream.h>, if you had no call for these then you need not include it. you can write your own headers and put constants, function/class declarations etc in them, although you should not include function/class definitions in a header. these are best in a source file and then compiled/linked in with the program.

for example

++++++++myheader.h

#define MY_CONSTANT   1000

class myclass
{
 public:
   void mymember();
}

++++++++mysource.cpp

#include "myheader.h"

void myclass::mymember()
{
 /* some code */
}
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question