sscanf strings to array problem
#1

Hello guys,

My english is not that good so I will try to explain the issue simply. I'm searching for solution about 2 hours and I can't find it.

I have string for example
Код:
"blah,blah"
but I don't know how many "blah" will this string contain. So it can be:
Код:
"blah,blah,blah"
or
Код:
"blah,blah,blah,blah,blah,blah,blah,blah,blah"
I was trying to do it this way:
Код:
	new arr[3];
	sscanf("Hello,Hi", "p<,>a<s[20]>[3]", arr);
        print(arr[1]);
but it returns
Код:
"ello,Hi"
Simply: I want to split the string after every "," and save the words as arr[0], arr[1].

Thank you for help.
Reply


Messages In This Thread
sscanf strings to array problem - by nikitasicek - 18.05.2014, 10:19
Re: sscanf strings to array problem - by Campbell- - 18.05.2014, 12:44
Re: sscanf strings to array problem - by RajatPawar - 18.05.2014, 12:58
Re: sscanf strings to array problem - by nikitasicek - 18.05.2014, 18:40

Forum Jump:


Users browsing this thread: 1 Guest(s)