error: 'oufile' was not declared in this scope|

This is the error I'm getting:
error: 'oufile' was not declared in this scope
I don't understand how to fix this. I declared 'outfile' before the main program, so shouldn't it be declared for the entire program? How do I fix this? Any help would be greatly appreciated. ( I put the line the error is on in bold)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

ifstream infile;
ifstream outfile;

int main()
{
    int a, b, c = 0;

    infile.open("triangle2.txt");
    if(!infile)
    {
        cout << "Error opening input file." << endl;
        return 1;
    }

    outfile.open("answers.out");
    if(!outfile)
    {
        cout << "Error opening output file." << endl;
        return 1;
    }

    infile >> a >> b >> c;
    while(infile)
    {
        oufile << setw(10) << a << " " << b << " " << c << endl;
        cout << setw(10) << a << " " << b << " " << c << endl;
    }
    return 0;

}
Well: oufile != outfile
Hahahaha! Oh geez. Thanks, coder.
How the heck did I not see that?! Lmfao.
Uh oh. So I fixed that, but now my error is this:

31|error: no match for 'operator<<' in 'outfile << std::setw(10)'|

What does that mean?
Topic archived. No new replies allowed.