Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!snorkelwacker.mit.edu!paperboy!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.c Subject: Re: confusion with char *a and char a[NUM] Message-ID: <1990Dec3.202520.25367@Think.COM> Date: 3 Dec 90 20:25:20 GMT References: <7656@umd5.umd.edu> Sender: news@Think.COM Distribution: na Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 18 In article <7656@umd5.umd.edu> jjk@astro.umd.edu( Jim Klavetter) writes: >However, if I have > a=strchr(string, ":"); >I get the error message > 121: incompatible types in assignment >or some such thing (that one is from gcc). Doug Gwyn already answered most of your questions, but he missed on problem with the above expression. The second argument to strchr() is supposed to be an int (according to the SunOS manual, but maybe ANSI says "char"), not a char*. Therefore, it should be a = strchr (string, ':'); -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar Brought to you by Super Global Mega Corp .com