Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Error with cc ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 25635 of 27272
Post > Topic >>

Error with cc sunstudio compiler

by happytoday <ehabaziz2001@[EMAIL PROTECTED] > Apr 15, 2008 at 03:36 PM

I compiled that program under turbo C without any problems but with
sunstudi I found those errors:

"pnt02ma1.c", line 37: warning: implicit function declaration: system
"pnt02ma1.c", line 58: operands must have arithmetic type: op "*"
"pnt02ma1.c", line 58: assignment type mismatch:
        pointer to float "=" double
"pnt02ma1.c", line 59: operands must have arithmetic type: op "/"
"pnt02ma1.c", line 60: operands have incompatible types:
         pointer to float "-" double
"pnt02ma1.c", line 61: operands must have arithmetic type: op "/"
"pnt02ma1.c", line 62: operands have incompatible types:
         pointer to float "-" double
"pnt02ma1.c", line 62: warning: improper pointer/integer combination:
op "="
cc: acomp failed for pnt02ma1.c


/*-----------------------pnt02ma1.c---------------------
Given those formulas
---inch = cm   /  2.45
---inch =(meter * 100)/2.45


---feet = 12 inch
---yard = 3 feet
---yard = 36 inch
---inch = 1/12 feet
---inch = 1/36 yard

---yard > feet > inch

convert given meter value to (yards , feet , and inches)

1-convert meter to the smallest unit = (inches).
2-obtain yards (biggest required value).
3-obtain the remainder inches after getting yards. m=m%36
4-obtain feet (second biggest required value).
5-obtain the remainder inches after getting feets.i=m%12
---------------------------------------*/


#include "stdio.h"

void input(float *);
void conversion(float *,int *,int *,int *);
void print_reults(float *,int *,int *,int *);
char another(void);

int main ()
{
float  meter;
int  yards,feet,inches;
do {
system("cls");
input(&meter);
conversion(&meter,&yards,&feet,&inches);
} while (another()=='y');
return 0;
}


void input(float *m)
{
printf("\nEnter size in meter :");
scanf("%f",m);
printf("\nYou have entered size in meter %.4f\n",*m);

}


void conversion(m,y,f,i)
float *m;
int *y,*f,*i;
{
m=m*100.0/2.54;
*y=m/36.0;
m=m-(*y)*36.0;
*f=m/12.0;
*i=m-(*f)*12.0;
printf("\n %.2f meter is = %4d yards %4d feet %4d inches
",*m,*y,*f,*i);
}


char another()
{
char a;
printf("\n\n Do ou want to another procees (y/n)");
scanf("\n%c",&a);
return (a);
}
 




 6 Posts in Topic:
Error with cc sunstudio compiler
happytoday <ehabaziz20  2008-04-15 15:36:06 
Re: Error with cc sunstudio compiler
Ian Collins <ian-news@  2008-04-16 10:51:56 
Re: Error with cc sunstudio compiler
Andrey Tarasevich <and  2008-04-15 15:55:03 
Re: Error with cc sunstudio compiler
Peter Nilsson <airia@[  2008-04-15 15:58:59 
Re: Error with cc sunstudio compiler
jt@[EMAIL PROTECTED] (Je  2008-04-15 23:13:28 
Re: Error with cc sunstudio compiler
Nikos Chantziaras <rea  2008-04-16 02:31:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 17:49:19 CDT 2008.