You people humble me with your willingness to help newbs.
Code:
struct primeList {
int prime;
struct primeList *next;
};
int importList(struct primeList *latestPrime, struct primeList *thisPrime) {
ifstream fin("fpf2.log");
while (fin) {
thisPrime = latestPrime;
latestPrime->next = new struct primeList;
latestPrime = latestPrime->next;
latestPrime->next = NULL;
fin >> latestPrime->prime;
}
latestPrime = thisPrime;
delete latestPrime->next;
latestPrime->next = NULL;
fin.close();
}
int main(int argc, char *argv[]) {
time_t start,end;
time (&start);
int lastTry = atoi(argv[1]);
struct primeList *firstPrime = new struct primeList;
firstPrime->next = NULL;
struct primeList *latestPrime = firstPrime;
struct primeList *thisPrime = firstPrime;
importList(latestPrime, thisPrime);
.......
.......
Unfortunately, this doesn't work. I'm not sure what in particular doesn't work, but it doesn't do that same thing as the code in my first post. It compiles without errors in Dev-C++ (I don't see why it wouldn't). Sorry for the lousy formatting; I don't know how to set up Dev-C++ to not auto tab.