Re: One String plus another one

From: Evan Harper (
Date: 03/05/03

On Wed, 5 Mar 2003, Marcel [iso-8859-1] Honstraß wrote:


> What i want is to join several strings together so that the output is still
> one string.


> (GET_OBJ_ARTICLE(obj) == 1) ? "der " +obj->short_description :( \


C does not have a concatenation operator for strings. This code will end
up adding the memory addresses of the constant string "der " and the
string obj->short_description, which makes no sense.

Solution: Use one of C's standard library functions like str(n)cat or
sprintf. Or use the definition to return only the article, and add the
description somewhere else.

This is a basic limitation of C, so I suggest you get fully up to speed on
C programming in general before jumping in to coding on Circle. Otherwise
you'll eventually need to rip out and re-do pretty much all of your early


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT