#include <iostream>
using namespace std;
#include <string>
#include<cstring>
int main()
{
char list1[50][31],list2[50][31],list3[100][31];
int i, size1, size2, i1, i2, i3;
char ch;
int inf;
ifstream indata;
ofstream outdata;
// read each list
while(inf.peek()= EOF)
{
inf>> list1;
i++;
size 1=i;
i=0;
}
while(inf.peek()= EOF)
{
inf>>list2; i++;
}
size 2=i;
while(i1< size1 && i2 < size 2)
{
if (list1[i1]< list2[i2])
{
list3[i3]=list1[i2];
i3++; i1++;
}
else
if(list2[i2]<list1[i2])
{
list3[i3]=list2[i2];
i3++; i2++;
}
else
{
list3[i3]=list2[i2];
i3++; i2++; i1++;
}
if(i1<size1)
{
inf>>"everything left on list1 to list3:";
inf.getline(name);
}
if(i2<size2)
{
inf<<"copy left on list2 to list3:";
inf.getline(ch);
}
}
return 0;
}
these are my errors
-----------------Configuration: assign3 - Win32 Debug--------------------
Compiling...
assign3.cpp
C:\assign3.cpp(13) : error C2079: 'indata' uses undefined class 'basic_ifstream<char,struct std::char_traits<char> >'
C:\assign3.cpp(14) : error C2079: 'outdata' uses undefined class 'basic_ofstream<char,struct std::char_traits<char> >'
C:\assign3.cpp(18) : error C2228: left of '.peek' must have class/struct/union type
C:\assign3.cpp(18) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
assign3.exe - 4 error(s), 0 warning(s)