| | |
please help with these error problems
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 13
Reputation:
Solved Threads: 0
#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)
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)
•
•
Join Date: Feb 2005
Posts: 30
Reputation:
Solved Threads: 1
add this to the top of your file
C++ Syntax (Toggle Plain Text)
#include <fstream>
![]() |
Similar Threads
- Linker error problems (C++)
- error problems (C++)
- PHP parsing error, unexpected '<' (PHP)
- C++ Compile Error's (C++)
- cannot find server or DNS error...i know... (Viruses, Spyware and other Nasties)
- OpeD7 & OpeC4 .exe error (Viruses, Spyware and other Nasties)
- rundll error (Viruses, Spyware and other Nasties)
- Problem Bridge.dll error & Freeze at Desktop (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: Choosing a programing languge.
- Next Thread: Round Robin Time Slicing
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





