#include<iostream>
#include<fstream>
using namespace std;
int main()
{
dnode<double> *listA = new dnode<double>;
dnode<double> *listB = new dnode<double>;
int val1; //first set of integers
int val2; //second set of integers
ifstream inFile; //declares the inFile
//Read in a file to build the two lists
inFile.open("lnkList.in"); //Open the input file
//statement for file not found
if (!inFile){
cout << "Unable to open file"; //output statement for file not found
exit(1); //terminate with error
}
inFile >> val1 >> val2;//reads in the file with a pair of integers
//Pointers to build the orginal two lists
dnode <double> *p = listA -> next; //points to the node following the header of listA
//Nested for loop to read in up to val1 # of doubles
for (int i = 0; i < val1; i++)
{
for (int j = 0; j < i; j++)
{
if(val1 < val)//the value at the pointer is less then the new value
{
*p -> next;//move the pointer forward.
}
else{
include (p, val);//else insert the new value now
}
}
dnode <double> *p2 = listB -> next; //points to the node following the header of listB
//Nested for loop to read in up to val2 # of doubles
for (int i = 0; i < val2; i++)
{
for (int j = 0; j < i; j++)
{
if(val2 < val)//the value at the pointer is less then the new value
{
*p2 -> next;//move the pointer forward.
}
else{
include (p2, val);//else insert the new value now
}
}
return 0;
}
this is what i have so far but I do not think that what i have is compiling correctly, i am trying to declare lists and i thought that is what i did. i have so many compiling errors, and i tried fixing them. but not working for me, any help?