Portability help

Marco Zagha marcoz at MARCOZ.BOLTZ.CS.CMU.EDU
Tue Feb 14 00:47:36 AEST 1989


In article <376 at lakesys.UUCP> davek at lakesys.UUCP (Dave Kraft) writes:

[...]
> main()
> {
>        char a, b, c, d, e;
> 	
>        [...]
>
> 	printf("\n>>%s<<", &a);
>	[...]
> }

As far as your core dump problem goes, you are trying to treat the
address of a single character as a string.  A string (in the
printf sense) is a pointer to a NULL TERMINATED string of characters.
You should be using the %c specifier as in other parts of your code.

== Marco (marcoz at cs.cmu.edu)
-- 



More information about the Comp.lang.c mailing list