Vyacheslav -

try:

char szMes[25];
void ReturnTestString(char* szSring, int Id);
ReturnTestString(szMes, 1);

the '&' sign before a variable name means "address-of the variable."  when
declaring the function, the name szString is just the name of the variable
inside the function.  ReturnTestString just needs to know the variable is a
string, which is char*.  btw, putting a * after a type (like char*) means
the variable is a pointer to that type.  for more info, check out:

http://www.cplusplus.com/doc/tutorial/tut3-2.html  (about strings)
http://www.cplusplus.com/doc/tutorial/tut3-3.html  (about pointers)


hope this helps,

barret



----- Original Message -----
From: "Vyacheslav Djura" <[EMAIL PROTECTED]>
To: "barret" <[EMAIL PROTECTED]>
Sent: Saturday, October 05, 2002 3:18 PM
Subject: Re[2]: [hlcoders] returning string


> Hello barret,
>
> Saturday, October 5, 2002, 3:56:48 PM, you wrote:
>
> b> hi -
>
> b> i did something similar, but i used:
>
> b> char szMes[25]; //need szMes to be a string, not a char.  in this case
an
> b> array of chars.
> b>                             //25 is just my guess for how big it can
get
> Then, how to write header of this function (char* &szSring,int Id) so
> array will be fixed (25) ?
> I am not good at C++'s "*"
> and "&"?
>
> thanks...
>
> --
> Best regards,
>  Vyacheslav                            mailto:[EMAIL PROTECTED]
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to