NotHisTechiness
11-20-01, 07:56 PM
ok, i'm trying to get the data from a .txt file and display the largest and smallest values from the .txt. the thing is, i don't know how to separate the data from the .txt file so it will display the data. also, the prices.txt is set so there's no need to take in account of variables other than the amount of characters. anywho, all and any help is appreciated and thanks in advance.
here's what i have so far:
#include <string.h>
#include <iostream.h>
#include <fstream.h>
void main()
{
char prices[30];
ifstream infile("prices.txt");
if (!infile)
{
cout << "Error Opening File" << endl;
exit (-1);
}
while (infile>>prices)
}
here's what i have so far:
#include <string.h>
#include <iostream.h>
#include <fstream.h>
void main()
{
char prices[30];
ifstream infile("prices.txt");
if (!infile)
{
cout << "Error Opening File" << endl;
exit (-1);
}
while (infile>>prices)
}