Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error "expected initializer before 'using'" c++ [closed]

Tags:

c++

im new here ,and new at proggraming in general . whem im trying to run this code:

#include<fstream>
#include <iostream>
#include "main.h"
using namespace std;
int main()
{
 short arr_size ()
float temp;
point point_arr[99];
ifstream my_file   ("points.txt");
while(!my_file.eof())
{
    my_file>>temp ;
    point_arr[arr_size].set_x(temp);
    my_file>>temp ;
    point_arr[arr_size].set_y(temp);
    arr_size++;
}
arr_size--;
my_file.close();
ex_point(point_array,arr_size);
cout<<"the middle point is:("<<mid_p(point_array,arr_size).get_x()<<","<<mid_p(point_array,arr_size).get_y()<<")\n";
return 0;
}

im getting this error : "error "expected initializer before 'using'" c++" this is the first time i get this error . it may be somthing wrong with "main.h" ? this is "main.h " :

    #ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#include<iostream>
class point
{
    float x ,y ;
public :
    point(float a,float b){x=a;y=b;}
    point(){};
    void set_x(float a){x=a;};
    void set_y(float b){x=b;};
    const float get_x(){return x; };
    const float get_y(){return y; };
    const void show();
    const float pitagoras();
};
const point mid_p(point[],float);
const void ex_point(point[],float)



#endif // MAIN_H_INCLUDED

thank you ! ivory

like image 982
user3316789 Avatar asked Feb 24 '14 19:02

user3316789


1 Answers

const void ex_point(point[],float)

at the end of main.h is missing a semicolon.

like image 87
Brian Bi Avatar answered Sep 20 '22 07:09

Brian Bi