Any help would be greatly appreciated.
This my code and the error messages follow:
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main() {
ofstream outfile("graph.txt");
int i,j;
for (i=10;i>=0; i=i-1); {
for (j=0; j<=0; j++);{
if (i>5); {
if ((j==i*2-10) || (j==20-(i*2-10)) || j==10)
outfile<<"X";
else
outfile<<".";
else if (i==5)
outfile<<"X";
else
if ((j==i*2+10) || (j==20 - (i*2+10)) || j==10
outfile<<"X";
else
outfile<<".";
}
}
outfile<<endl;
}
for (i=5;i>0;i=i-1);{
for (j=0;j<=20;j++);{
if (j==10);
outfile << "X";
else
outfile << ".";
}
outfile<<endl;
}
outfile.close();
cout >>'All Done!'>> endl;
return 0;
}
Error Messages:
project1.cpp:47:10: warning: character constant too long for its type
project1.cpp: In function âint main()â:
project1.cpp:25: error: expected primary-expression before âelseâ
project1.cpp:25: error: expected `;' before âelseâ
project1.cpp:27: error: expected primary-expression before âelseâ
project1.cpp:27: error: expected `;' before âelseâ
project1.cpp:30: error: expected primary-expression before âelseâ
project1.cpp:30: error: expected `;' before âelseâ
project1.cpp:40: error: expected primary-expression before âelseâ
project1.cpp:40: error: expected `;' before âelseâ
project1.cpp:47: error: no match for âoperator>>â in âstd::cout >> 1869505825â
*Mod Edit: added code tags:

New Topic/Question
Reply




MultiQuote








|