423,516 Members | 2,039 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,516 IT Pros & Developers. It's quick & easy.

# Parse Error

P: 1
I'm trying to compile my program using "gcc" and keep getting a parse error at end of input. Can anyone help me?
Attached Files
 rose_curve2.txt (918 Bytes, 207 views)
Nov 28 '08 #1
Share this Question
2 Replies

 Expert 100+ P: 1,275 You were missing a couple of braces. Check the following code Expand|Select|Wrap|Line Numbers /* Program #25 -- file prgm25.c rev. 11/26/08 This program will give you points on a graph in a file called "rosecurve.txt". These points will create a rose curve. */   #include  #include  #include    float polar_to_x(float, float); float polar_to_y(float, float);   int main() {     float thata,temp,n,x,y,p,j,r=5,s=3;     int a,b;     FILE *output;       output=fopen("rosecurve2.txt","wt");       for(j=0;j<6.28;j+=0.01)     {         n=r/s;         temp=r*s;         for(a=1;a<31;a+=2)         if(temp==a)         {             thata=3.14159*s*1;             break;         }         for(b=0;b<32;b+=2)         if(temp==b)         {             thata=3.14159*s*2;             break;             {             x=polar_to_x(n,thata);             y=polar_to_y(n,thata);             fprintf(output,"%f %f\n",x,y);             }         }     }     fclose(output); }     float polar_to_x(float n,float thata) {     float x;       x=n*cos(thata);     return x; }   float polar_to_y(float n,float thata) { float y;   y=n*sin(thata); return y; }     Raghu Nov 28 '08 #2

 Expert Mod 5K+ P: 8,916 You have a brace on your second if statement the wrong way round Nov 28 '08 #3

### Post your reply

Sign in to post your reply or Sign up for a free account.