home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!navajo!shulick
- From: shulick@navajo.ucs.indiana.edu (Sam Hulick)
- Subject: Re: wierd sas/c bug
- Message-ID: <BzJ0yo.3FE@usenet.ucs.indiana.edu>
- Sender: news@usenet.ucs.indiana.edu (USENET News System)
- Nntp-Posting-Host: navajo.ucs.indiana.edu
- Organization: Vallen Software
- References: <BzIw0y.n31@ccu.umanitoba.ca>
- Date: Sat, 19 Dec 1992 21:56:48 GMT
- Lines: 30
-
- In article <BzIw0y.n31@ccu.umanitoba.ca>, umfehr06@ccu.umanitoba.ca (John Fehr) says most sayishly:
- >I've been trying to compile an lpmud driver with sas/c, and I've
- >come upon a wierd bug... In my main program file, I have the following
- >code:
- >
- >char master_file = "obj/master";
- >
- >...
- >main() {
- >/* bunch of other variables declared */
- > printf("master_file='%s'\n",master_file);
- >...
- >
- >When I compile and run this, I get:
- >
- >master_file='bj/master'
- >
- >Has anyone run across this bug? That printf was the first statement
-
- It's not a bug. Do you know C very well? Tell me how you expect
- master_file to hold an entire string, when it's only a single character.
- Try this:
-
- char master_file[] = "obj/master";
-
- --
- // Amiga 3000 ___ \ Sam Hulick: shulick@indiana.edu (NeXTmail OK!)
- // 68030 25 MHz /__/\ \ My opinions wear combat boots. Or whatever.
- \\// OS 2.04 \__\/ / "Walk! Not bloody likely. I am going in a
- \/ / taxi." --George Bernard Shaw
-