In search of advice
#6

s[20]d as simple as that, there is also another way to do that, that is sscanf(type,"'deposit'd",amount)
What that does is simply look for word "deposit" in type, then get the amount which was entered after it, so there wouldn't be a need to get the deposit again in sscanf (I hope you got the idea of how to do it).
I love these type of topics, I usually take a quick look at topics, and when I feel like topic isn't a "I have no brain, please exhaust yours for my benefit" I reply fast as I can to help them.
Feel free to ask any more questions you want, will be happy to help.

Quote:
Originally Posted by Josh_Lotus
Посмотреть сообщение
PHP код:
if(strcmp(type"savings") == 0
About the 'strcmp', shouldn't I define the string length?

Thanks
about that, if you want to check whole string to another one, no you don't need to specify the length, but as your CMD works, first sscanf would store "deposit 1000" in the type string, which wouldn't be equal to "deposit".
However if you just check the first 7 letters of it, it does, therefore you should use string length for partial checks.
Reply


Messages In This Thread
In search of advice - by Josh_Lotus - 08.01.2016, 13:17
Re: In search of advice - by Rufio - 08.01.2016, 13:27
Re: In search of advice - by Josh_Lotus - 08.01.2016, 13:31
Re: In search of advice - by justinnater - 08.01.2016, 13:42
Re: In search of advice - by Josh_Lotus - 08.01.2016, 13:53
Re: In search of advice - by PrO.GameR - 08.01.2016, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)