[comp.lang.c] 2 simple questions from a beginner

v056ped5@ubvmsb.cc.buffalo.edu (Brian M McNamara) (03/07/91)

I am using Turbo C...

Q1:
	I have three files, each with a header file. Call them A,B,C.

A.c calls B.c and C.c as well as B.h and C.h
B.c calls B.h and A.h
C.c calls C.h and A.h
They all call another .lib file

How do I set the makefile? I am getting them to compile by using the
build-all option from within the editor and then linking externally,
but I would like to use the makefile so I can use a quicker smaller
editor to do the code. My memory restrictions do not allow placing
everything in one file.

Q2:
	I have a data file which consists of a list of two names 
(first and last), but needs  to be edited through an ascii editor. The 
EOL characte is being printed as some weird character from the ASCII
tables. How can I get rid of this? I need to find the character causing
the problem and change it to a regular null character but I have tried
about fifty different ways and can't get it to work.

Please mail any help you can. Thanks in advance,
Brian

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (03/07/91)

In article <63740@eerie.acsu.Buffalo.EDU> v056ped5@ubvmsb.cc.buffalo.edu writes:
>
>I am using Turbo C...
>
>Q1:
>	I have three files, each with a header file. Call them A,B,C.
>
>A.c calls B.c and C.c as well as B.h and C.h
>B.c calls B.h and A.h
>C.c calls C.h and A.h
>They all call another .lib file

Make a .PRJ file (if you are using Turbo C++, should be something like it
in plain TC)....  Next, it is a pretty bad habit on DOS machines to include
.C files....instead, just put them on the .PRJ file or .MAK file to be
linked in and you will avoid a LOT of potential conflicts.

.H files should be able to be included as many times you need during the
build....however, some do this:
#ifndef __INCLUDE_NAME_H
#define __INCLUDE_NAME_H

....

#endif


This is to avoid multiple inclusions.

Brian

yedinak@motcid.UUCP (Mark A. Yedinak) (03/09/91)

jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:

:....  Next, it is a pretty bad habit on DOS machines to include
:.C files....

More inportantly,  from a software engineering point of view,  it is not a good
idea to include source files via the #include statement.  Linkers exist for this
purpose.


-- 
Mark A. Yedinak - uunet!motcid!yedinak 		*  "Don't take life too
Motorola - General Systems Sector		*   seriously, you will
3205 Wilke Road, Arlington Heights, IL 60004	*   never get out of it
708-632-2874  (I said it, not the big M)	*         ALIVE!"