#60 Function return value can't be used as argument

compiler
closed-fixed
John Hansen
NXC (53)
5
2009-11-23
2009-01-16
Luna Kid
No

Sorry if this is documented, can't remember right now. If it is, then please take this as a "feature request".

string msg;

//!! Compiler error:
msg = StrCat("some text ", NumToStr(5));

// OK:
msg = NumToStr(5);
msg = StrCat("some text ", msg);

Discussion

  • John Hansen
    John Hansen
    2009-11-23

    Use strcat in the latest NBC/NXC/BricxCC test release. The strcat function supports a second argument that is the return value of a function call.

    string strcat(string & dest, const string src);

     
  • John Hansen
    John Hansen
    2009-11-23

    • status: open --> closed-fixed