473,417 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

Autodidatta col C---Errore invalid type argument of unary '*' (have 'float')

1
Salve, appena iscritta e sono una studentessa di Liceo, per cui siate magnanimi.
Uso codeblock e mi sta aiutando a capire le basi del C.
Ho scritto un programma semplice e compilandolo mi dà quell'errore. Da cosa dipende? Non riesco a capire. L'errore me lo dà
alla riga 21 costoTotAllog = .....ma ho visto che eliminando questa riga,ripresenta l'errore anche alla successiva per cui qualcosa non gli piace sulle variabili dichiarate credo o sul risultato dell'operazione che scrivo. Poi alla riga 7 mi chiede "errore: exspected ')' before ';' token.

Riporto il codice. Grazie a chi mi risponderà. Ciao.

#include <stdlib.h>
#include <stdio.h>
#include <locale.h>

#define TASSE 15;
#define COSTOPANINO 1.50;
#define COSTOLITRO 2.50;
#define AUTOBUS 2;
#define COSTOALLOGGIO 10;

int main(void)

{
float acqua,panini,costoTotAutob,alloggio,numLitri,giorn i,numPanini,costoTotAllog,totale;
int persone;

setlocale(LC_CTYPE, "italian");

printf("Questo programma calcola la spesa complessiva per una famiglia\n");
printf("Dimmi il numero di persone che verranno in vacanza\n");
scanf("%d",&persone);
costoTotAllog = COSTOALLOGGIO*persone;
costoTotAutob = AUTOBUS*persone;
printf("Dimmi quanti giorni rimarrete\n");
scanf("%f",&giorni);
alloggio=costo;
printf("Dimmi quanta litri di acqua consumate giornalmente\n");
scanf("%f",&numLitri);
acqua=(COSTOLITRO*numLitri)*giorni;
printf("Dimmi quanti panini consuma ogni persona giornalmente\n");
scanf("%f",&numPanini);
totale=acqua+panini+costoTotAutob+alloggio+acqua+T ASSE;
print("La spesa complessiva per una famiglia di %f persone che vuole stare in questo campeggio per %f giorni é %f euro\n",persone, giorni, totale);

system("pause");
return 0;

}
Aug 31 '22 #1
0 3461

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

Similar topics

2
by: CoolPint | last post by:
As a self-exercise, I am trying to write a generic Priority Queue, which would store any type and and accept any user-definable "priority" function. After much tinkering, I came up with...
19
by: Lucas Machado | last post by:
i'm doing some Linux Kernel hacking for a course i'm currently taking. there is a pointer to a struct (struct example_struct *ex_ptr) in a .c that i want to access in a system call. i defined a...
2
by: newbie29 | last post by:
I get this error "invalid type argument of '->'". It occurs when: if (num_process->t_pid == -1) { .... } I have defined the struct num_process in the same file as where the above is...
4
by: bob | last post by:
I have little C experience and am concurrently trying to tackle C and LKM's (a little too ambitious maybe) anyway here is the problem I'm having with an example module I found. static int...
3
by: Suyash Upadhyay | last post by:
Hello all, I was writing a code regarding offset of structure elements. struct a { struct b { int i; float f; char ch; }x;
5
by: Sheldon | last post by:
Hi Everyone, I have defined a function: struct Transient arrFromHdfNode(HL_NodeList *nodelist, struct Transient retv); and in the code: struct Transient arrFromHdfNode(HL_NodeList...
4
Siddarth777
by: Siddarth777 | last post by:
#include<stdio.h> main() { int *a=5; int **p=&a; fflush(stdin); printf("%u,%u,%d",p,*p,**p); } getting compiled perfectly but am getting
2
by: Stephanie Smith | last post by:
I always get this error message! Here's the code: #include <stdio.h> #include <stdlib.h> int main(void) { char *string; char length_string = 0; char buffer_for_string = 0;
1
by: adimustdie | last post by:
char *chktype(char *Buffer, int Size)//checks the Content-Type and gives extension { unsigned short iphdrlen; struct iphdr *iph = (struct iphdr *)( Buffer + sizeof(struct ethhdr)...
1
by: nsbcnjsbc | last post by:
What's wrong?here's the code #include<stdio.h> #include<stdlib.h> #define pi 3.141592; int main(void)
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.