help with strcat

Christopher R Volpe volpe at camelback.crd.ge.com
Wed Jun 5 22:16:55 AEST 1991


In article <1991Jun4.210209.28463 at ux1.cso.uiuc.edu>,
gordon at osiris.cso.uiuc.edu (John Gordon) writes:
|>char *str1 = "Joseph went";
|>char *str2 ' " to the store.";
|>char str3[100];
|>
|>strcat(str3, str1); /* tacks str1 onto the end of str3 */

And where's the end of str3 if it hasn't been initialized? Use strcpy for
the first component instead.

|>strcat(str3, str2); /* tacks str2 onto the end of str3 */
|>
|>/* str3 should now be "Joseph went to the store." */
|>
|>
|>---
|>John Gordon
|>Internet: gordon at osiris.cso.uiuc.edu        #include <disclaimer.h>
|>          gordon at cerl.cecer.army.mil       #include <clever_saying.h>
                       
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list