when i have getline(ifIn, strFile); in my program does it require imput from the user.
if in is my ifstream
strFile is my string i am reading the file into
when i have getline(ifIn, strFile); in my program does it require imput from the user.
if in is my ifstream
strFile is my string i am reading the file into
no.
what is wrong with this: (when i run my program it gets to the while loop and stops, it stays in the program but doesn't do anything)
[code]
while (!ifIn.eof()); // I think the problem is here
{
int i=0;
//-------then rest of code---------
well what exactly are you trying to do? input into a char? string array?
input into a string array
Read the FAQ about eof() and feof() etc.
While loops look like this...
notCode:while (condition_true) { // do this}
Code:while (condition_true); {// cant get here}
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi