strcat problem
#1

Hi,
Код:
enum Enum
{
	memberslist[256],
...
...
}
Код:
strcat(Array[id][memberslist],form("%s ",pName(playerid)));
printf("array id %d, string = '%s'",id,Array[id][memberslist]);
prints "array id 0, string = 'NULL'"
functions form() and pName() are ok and working.

It should add player name to the string with a space, like
Quote:

Name_First Name_Second Name_Third

What's wrong?
Reply
#2

PHP код:
strcat(Array[id][memberslist],form("%s ",pName(playerid))); 
to
PHP код:
format(Array[id][memberslist],256,"%s ",pName(playerid)); 
Does it work?
Reply
#3

Quote:
Originally Posted by MarvinPWN
Посмотреть сообщение
PHP код:
strcat(Array[id][memberslist],form("%s ",pName(playerid))); 
to
PHP код:
format(Array[id][memberslist],256,"%s ",pName(playerid)); 
Does it work?
No, new names will be added to current name so I muse use strcat.

FIXED: had to type string size (3rd strcat parameter) since enums don't work like I thought
Reply
#4

Now I got another problem.
As soon as I do strcat, my string is now
"NULLName_First"
How do I remove the NULL in the beginning?
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)