Here is the function which I want to use to write to the output file
(line_elements is a structure which is defined globally)
Code:
int ann_bln_out (line_elements point1, line_elements point2, line_elements point3, \
ofstream out_file_stream)
// Point 1 is symbol loc, points 2 and 3 are used to calculate orthogonal offset
{
// Declare variables for calculation
float bln_len = map_scale * 0.15/200*1.2;
float dx, dy, hyp;
float end_x_coord, end_y_coord;
// Calculation of end coordinates
dx = point3.x_coord - point2.x_coord;
dy = point3.y_coord - point2.y_coord;
hyp = sqrt(dx*dx+dy*dy);
end_x_coord = bln_len * dy/hyp + point1.x_coord;
end_y_coord = bln_len * dx/hyp + point1.y_coord;
// Output to annotation file
out_file_stream << "2, 0 " << point1.sp_no << endl \
<< point1.x_coord << "," << point1.y_coord << endl \
<< end_x_coord << "," << end_y_coord << endl;
return(0);
}
Here are the parts of main where the output stream is created and the function is called
Code:
ofstream out_files_ann_bln (out_files_ann_bln);
// Output first point to annotation file
ann_bln_out (last_line, last_line, current_line, out_files_ann_bln);
(last_line and current_line are variables of type line_elements)
The error this creates in the compiler is:
In copy constructor ` std::basic_ios<char, std::char_traits<char> >::basic_ios(const ` std::ios_base::ios_base(const std::ios_base&)' is private within this context
I'm afraid I don't know enough of C++ to understand this or correct it.
Grateful for your assistance.