Friday, July 31, 2009

C Language keep getting an error?

#include%26lt;stdio.h%26gt;


#include%26lt;stdafx.h%26gt;


#include%26lt;conio.h%26gt;


#include%26lt;cmath%26gt;


using namespace std;








int main();











{float x1,x2,y1,y2; ***** I get a error C2447: '{' : missing function header (old-style formal list?) For this line





float d;


x1=26; y1=80;


printf("Enter Hurricane Latitude")


scanf("hurricane Latitude")





scanf_s("%f, %f, %f, %f",%26amp;x1,%26amp;x2,%26amp;y1,%26amp;y2);


d=sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));


printf("%f",d);


getch();


return 0;

C Language keep getting an error?
Some Semicolons are missing on the printf and scanf.





Do you get this error using those libraries in other programs?
Reply:First remove the semicolon after the main function.


int main()


{


//function body goes here...


}


next put a semicolon after printf() call


printf("Enter Hurricane...Latitude");


your scanf call is not correct... I dont know what you are scanf() ing otherwise i would have told you what to do...


put a closing flower bracket after return 0;


}


remove ***** I get a error C2447: '{' : missing function header (old-style formal list?) For this line


No comments:

Post a Comment