N
news.hku.hk
is there any way to make a loop to store strings??
e.g. abc.txt contains 3 lines i.e.
this is line 1.
this is line 2.
this is line 3.
i want to create a loop that can make the three strings contains the
corresponding lines,
string line1; //contains "this is line1."
string line2; // contains "this is line2."
string line3; // contains "this is line3."
int no_of_lines = 3;
can a simple for loop do this ??
thanks a lot
e.g. abc.txt contains 3 lines i.e.
this is line 1.
this is line 2.
this is line 3.
i want to create a loop that can make the three strings contains the
corresponding lines,
string line1; //contains "this is line1."
string line2; // contains "this is line2."
string line3; // contains "this is line3."
int no_of_lines = 3;
can a simple for loop do this ??
thanks a lot