escape in strcmp
#1

Hi,

I need use escape in when strmp?
Reply
#2

What you mean ?
You meant to use escape sequences in strcmp?
\\ mean single \ in string.
Reply
#3

Yes ,but if there just \ i can strcmp?


strcmp("\","something")

?
Reply
#4

I really don't like being an asshole here, but your questions are really starting to get on my nerves.
I suggest you start listening to others, or else you won't learn (You still haven't) anything.

A lot of people here told you to test simple stuff and find out yourself.

Here's a simple line of code that'll answer your question:
Код:
printf("%i\n%i\n%i", strcmp("\\test", "\test"), strcmp("\test", "\test"), strcmp("\\test", "\\test"));
strcmp returns 0 when the two strings you're comparing are equal.
Reply
#5

But if there just \ without test ?
Reply
#6

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
But if there just \ without test ?
you have hands ,a keyboard and pawno application try it yourself
Reply
#7

I can't write string only \
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=199796
Reply
#9

In pawn the '\' is known as the escape character, so any character that follows after the '\' will be escaped for example:

Код:
print( "MJ said \"Music\" is great." );
As you can see I put two '\' ( backslashes ) before each quotation mark. This is because I don't want the compiler to think my string has ended when it gets to "Music". So by using the escape character I have told the compiler to ignore the following character and treat it like its still a string.

Offtopic: I seem to have more patient then the previous posters.
Reply
#10

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
I can't write string only \
Thats what we both told you before.Now you understood?

Quote:
Originally Posted by azzerking
Посмотреть сообщение
Offtopic: I seem to have more patient then the previous posters.
Try to help more in his threads and check his background and former threads.Your patience eventually will become destroyed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)