|
-
May 20th, 2002, 02:48 AM
#1
ifstream
hi!
i have a function to read integers from text file and put them respectively in an array. But... the result is not doing that....instead of that it store the last integer from text file as all elements of the array.... i wonder why...can somebody help me with this? Thanks
void Tau::readFile()
{
int arr=0;
ifstream inClientFile("data3.txt");
N=ReadNValue();
int n=readNumVar();
while (inClientFile>>arr)
{
for (int i=0;i<N;++i)
{
for (int j=0;j<n;++j)
{
Buff[i][j]=arr;
}
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|