how to modify this code and input this list as input

i see this code in this thread, i want to know how to get input by user or from file in this code. for example this list how to use it as input in this code. i don't know how to modify and how to use it.

Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#include <iostream>
#include <fstream>

using namespace std;

int
    a = 0,
    b = 0;

ifstream In( "Input.txt" );


while( In.good() )
    {
    In >> a;

    In >> b;

    /*    Do something with a and b:    */

    }    /*    while( In.good() )    */

Last edited on
i tried but getting errors. check and modify thnx
Last edited on
It's just as the error says: You are calling the triangle constructor with three integers; however, triangle's only constructor takes points. Either overload the constructor to take points, make the arguments templates, or try casting your ints to points.
i don't know how to do it.
please specify some code
Add this constructor to your triangle class:

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

triangle( int a1, int b1, int c1 )
    {
    point
        p1,
        p2,
        p3;


    p1.x = a1;

    p2.x = b1;

    p2.x = c1;

    a = p1;

    b = p2;

    c = p3;

    }



i tried this, thanx Kooth for guidence.
but when i am entering different number in input file.
Last edited on
anyone reply me.
thnx
Topic archived. No new replies allowed.