i cant figure out how to fix this!!!
its suppose to make a file called legs and make the text in the file legs,legs,legs and then its suppose to open the previously created legs file!! but it doesntCode:#include <iostream> #include <fstream> using namespace std; int main() { ofstream legs; legs.open("legs.txt"); legs<<"legs,legs,legs"<<endl; legs.close(); system("pause"); ifstream legs("legs.txt") return 0; };
and the log of the errors
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
main.cpp: In function `int main()':
main.cpp:13: error: conflicting declaration 'std::ifstream legs'
main.cpp:8: error: 'legs' has a previous declaration as `std:fstream legs'
main.cpp:13: error: declaration of `std::ifstream legs'
main.cpp:8: error: conflicts with previous declaration `std:fstream legs'
make.exe: *** [main.o] Error 1
Execution terminated



LinkBack URL
About LinkBacks
fstream legs'


