split to two lines
#1

hey all,
i need your help in something i had this: new text[3000]
and that what i write in it...

1\n2\n3\n4\n
that example
and i want when has \n or \r that split it to two strings like
new string1[4],string2[4];

string1 was 1
and string2 was 2 and that with all 3 and 4...
and i need the smartest and the fastest way... and think i have a 100 - 300 lines in the file

thx for who can help me,
sorry for my bad english!!!!!
Reply
#2

pawn Код:
new text1[150],text2[150],text3[150],text4[150];
If i help you give me rep +
Reply
#3

https://sampwiki.blast.hk/wiki/Strmid
https://sampwiki.blast.hk/wiki/Strfind

or you can use sscanf
Reply
#4

Quote:
Originally Posted by DeStunter
Посмотреть сообщение
you can tell me how to do that listen the text change that read that from file
you can give me example how to use.. thx.
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
"fread" reads files line-by-line anyway.
I know that but i need that for something other and i needed and i dont want to do like this
new text[300(lines)][3000] I had a reason why i do that like that,
if you can explain that be good for me
Reply
#6

please someone help me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)