help with strcmp
#1

if(!strcmp(name, "Sasuke_Uchiha", true)) how can i add 2 or more names like sasuke_uchiha can use this cmd too and arose can too
Reply
#2

if(!strcmp(name, "Sasuke_Uchiha", true) || !strcmp(name, "", true))

the || is an operator that means or. You can do that for each name so in psuedo that line says.
If the string is "Sasuke_Uchiha" OR "" then.

This is a really inefficient way of doing things, but it is ONE way to how you have written it.
Reply
#3

Quote:
Originally Posted by BKarner
Посмотреть сообщение
if(!strcmp(name, "Sasuke_Uchiha", true) || !strcmp(name, "", true))
but see there is one less "(" bracket where i add before !strcmp ??
or will it work like that
Reply
#4

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
but see there is one less "(" bracket where i add before !strcmp ??
or will it work like that
It will work like that. If you add in another bracket it will assume there's another function to look for, which there isn't.
Reply
#5

Yes it will work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)