strcmp
#1

Ye i know this might be a foolish question, but i dont want any risks and thus will ask before doing stuff.

we use !strcmp(.... with the ! before strcmp to check if they are same, but how do i check if they arent same?? (dont tell me to do if(!strcmp(... ) else (...)). do i remove the ! ?
Reply
#2

Yes, you remove the ! because if you use ! it's basically the same thing as == 0 and if you remove it then it's the same thing as > 0.
Reply
#3

Код:
if(strcmp(string1,string2,true) == 0)
to

Код:
if(strcmp(string1,string2,true) != 0)
It's the same exact thing as GoldenLion has suggested you to do.
Reply
#4

Quote:

Header size: 16808 bytes
Code size: 981680 bytes
Data size: 17509204 bytes
Stack/heap size: 25600 bytes; estimated max. usage: unknown, due to recursion
Total requirements:18533292 bytes

Comments please.
Reply
#5

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Comments please.
This doesn't do anything as far as I know and only shows up if you compile with debug info. But I heard you can do something with pragma dynamic, I'm not sure. I don't know anything about that lol.
Reply
#6

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Comments please.
Normal thing when you use the -d3 debug setting.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
If it showed up because you compiled with -d3 or -v, then no. You should only be worried if the estimated max exceeds the stack size.
Ask him
Reply
#8

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
[..] and if you remove it then it's the same thing as > 0.
Not equal to 0, it can be both negative or positive number.

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
[..] But I heard you can do something with pragma dynamic, I'm not sure.
Quote:
Originally Posted by iamjems
Посмотреть сообщение
Normal thing when you use the -d3 debug setting.
Код:
Stack/heap size: 25600 bytes; estimated max. usage: unknown, due to recursion
By default, it is 16384 bytes so #pragma dynamic has been used. Recursion is another reason it'd pop out. You shouldn't worry unless you get a run time error but it is still advised to use smaller local strings.
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Not equal to 0, it can be both negative or positive number.
Right, I totally forgot about that.
Reply
#10

I didnt mean why is it there... I meant, what do those numbers say? how much memroy / ram is it going to require.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)