Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!rutgers!ames!lll-tis!ptsfa!ihnp4!inuxc!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: 2 questions (Turbo C) Message-ID: <1063@bsu-cs.UUCP> Date: Sat, 29-Aug-87 12:13:50 EDT Article-I.D.: bsu-cs.1063 Posted: Sat Aug 29 12:13:50 1987 Date-Received: Sun, 30-Aug-87 09:18:02 EDT References: <9034@brl-adm.ARPA> <3432@zen.berkeley.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 16 Summary: Avoid hard-coded filenames, use / in pathnames In article <3432@zen.berkeley.edu> schung@cory.Berkeley.EDU.UUCP writes: > >Classic error: \t = tab, not '\''t', and \h = god knows what. > >Fix: if ( (infile = fopen("c:\\temp\\helpfile", "r")) == NULL) I heartily recommend: #define HELPFILE "/temp/helpfile" /* note forward slashes */ if ( (infile = fopen(HELPFILE, "r")) == NULL) It works, it looks nicer, it's easier to modify, and it's easier to port to other operating systems, especially the **IX family. -- Rahul Dhesi UUCP: {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi