Main.cc: In function 'int main()': Main.cc:6:9: error: 'x2' was not declared in this scope cin>>x2>>y2; ^ Main.cc:4:14: warning: unused variable 'xx2' [-Wunused-variable] int x1,y1,xx2,y2,x,y; ^