new in pawno, help
#3

@Vince, how do you know if it represents a starting point or a single character? And also why do we use something like idx in strtok, strrest functions? You create new variable named idx with no value, use it as a &index in those functions. What does & mean before &index? If idx doesn't have a value then why we need to use it? I say it has no value because;
Code:
new cmd[128], idx;
	cmd = strtok(cmdtext, idx);
As you can see, after creating it, you set no value to it. You use directly in strtok function.

btw, info of strtok:
Quote:

This (strtok) is used to search a string and find a variable typed after a " " (space), then return it as a string.

So if it finds the value after space and returns it, why do you need an additional second argument like idx? Let me explain what I say.

Code:
new 
     string[128],
     splitted[128]
;

string = "Hello world I am trying to understand pawn."

splitted = strtok(string,[IDK WHAT TO PUT HERE, IN MY VIEW YOU DONT NEED TO PUT SOMETHING])
splitted must be "world I am trying to understand pawn." because strtok found the thing after the space and returned it. Am I wrong?

I would be really happy if you answer all of these.
Reply


Messages In This Thread
new in pawno, help - by fiha4155 - 16.06.2017, 02:33
Re: new in pawno, help - by Vince - 16.06.2017, 09:11
Re: new in pawno, help - by fiha4155 - 17.06.2017, 16:54
Re: new in pawno, help - by Vince - 17.06.2017, 18:29
Re: new in pawno, help - by DRIFT_HUNTER - 17.06.2017, 19:50
Re: new in pawno, help - by OneDay - 18.06.2017, 07:08
Re: new in pawno, help - by fiha4155 - 18.06.2017, 11:09
Re: new in pawno, help - by Dayrion - 18.06.2017, 11:14
Re: new in pawno, help - by fiha4155 - 18.06.2017, 11:26
Re: new in pawno, help - by DRIFT_HUNTER - 18.06.2017, 11:49
Re: new in pawno, help - by fiha4155 - 18.06.2017, 11:55
Re: new in pawno, help - by BigETI - 18.06.2017, 18:21

Forum Jump:


Users browsing this thread: 1 Guest(s)