Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!bellcore!tness7!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: string assignment in C Message-ID: <1885@ficc.uu.net> Date: 14 Oct 88 15:01:07 GMT References: <1988Oct11.143728.28627@gpu.utcs.toronto.edu> <6777@chinet.chi.il.us> Organization: SCADA Lines: 21 In article <6777@chinet.chi.il.us>, john@chinet.chi.il.us (John Mundt) writes: > Now, this would be different: > char p[] = { 't','h','i','s',' ','a',' ','s','t','r','i','n','g','\n' }; > main() > { > printf(p); > } Different all right. You forgot to terminate your string. Your milage will vary, but I got: % a.out | vcat this a string l&^Z'.^R% [] [] is the cursor. -- Peter da Silva `-_-' Ferranti International Controls Corporation. "Have you hugged U your wolf today?" peter@ficc.uu.net