strdel
#1

Hi,

If i strdel string, and use strlenght that string lenght it's not crash server, or player client?

strdel(string,0,strlen(string) );
Reply
#2

What about you hop in-game and test it?
Reply
#3

I don't get crash, but i mean it's safe use for everytime?
Reply
#4

Why would it crash lol , the strdel - deletes a part of string.
Reply
#5

But if i want to del, all string to end, i have to use strlen(string) or strlen(string)-1 ?
Reply
#6

You have to use strlen only. No need to subtract 1. It's safe.
Reply
#7

If you want to empty a string you can just do
Код:
string[0] = EOS
or
Код:
string[0] = '\0'
Reply
#8

Use strdel only if you want to delete a part of a string, or equal the last index that is going to be used to EOS (End Of String).

If you want to empty a string, equal the first index (index 0) to EOS.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)