20.05.2011, 20:51
Hi guys... this question seems to be a bit noobish or w/e however I don't work that much with text files (most often mysql and stuff), so I don't really know about it...
I want to add a list with names into a file called "names"
now I want to create a function that returns true or false (depends if the name was found in the list or not)...
to do that I need to split the text of the file into an array, seperated by the line breaks (\r\n)...
now my question is: how do I split each line into an array...
e.g.
new list[][] =
{
"Joe", "Mike", "Charlie", "Chris"
};
would be my array without the file...
I hope you understand what I mean^^
I want to add a list with names into a file called "names"
now I want to create a function that returns true or false (depends if the name was found in the list or not)...
to do that I need to split the text of the file into an array, seperated by the line breaks (\r\n)...
now my question is: how do I split each line into an array...
e.g.
new list[][] =
{
"Joe", "Mike", "Charlie", "Chris"
};
would be my array without the file...
I hope you understand what I mean^^