please help with these error problems

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2004
Posts: 13
Reputation: missy is an unknown quantity at this point 
Solved Threads: 0
missy missy is offline Offline
Newbie Poster

please help with these error problems

 
0
  #1
Feb 24th, 2005
#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];
i++;
size 1=i;
i=0;
}
while(inf.peek()= EOF)
{
inf>>list2[i]; 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[i]);
}
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)
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: please help with these error problems

 
0
  #2
Feb 24th, 2005
missy\assign3.cpp: error C0001: missing code tags
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 30
Reputation: Intel is an unknown quantity at this point 
Solved Threads: 1
Intel Intel is offline Offline
Light Poster

Re: please help with these error problems

 
0
  #3
Feb 24th, 2005
add this to the top of your file
  1. #include <fstream>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC