![]() |
|
#1
|
|||
|
|||
Opperand variable type errors.Ok the source code for the program is listed below,along with the program outline.
And here are the problems with the program that im experiencing. Wedit output window build: Fri Nov 06 16:57:55 2009 e:\cop2000\project6\#6.c: Error #6.c: 47 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 47 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 48 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 48 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 49 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 49 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 50 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 50 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 54 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 54 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 55 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 55 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 56 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 56 operands of = have illegal types 'pointer to int' and 'int' Error #6.c: 57 operands of / have illegal types 'pointer to int' and 'double' Error #6.c: 57 operands of = have illegal types 'pointer to int' and 'int' Compilation + link time:0.6 sec, Return code: 1 /*Problem: write a program to dispense change.The user enters the ammount paid and the ammount due.The program determines how many dollars,quarters,dimes,nickles,pennies to give as change. write a function with four parameters that determines the quantity of each kind of coin.Also the program needs a for loop so the user can stop when the wish. CPP / C++ / C Code:
Last edited by LuciWiz : 08-Nov-2009 at 09:53.
Reason: Please insert your C code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Opperand variable type errors.CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Opperand variable type errors.Quote:
Where is this place , I'd like to shop there. I got a big-A change sack to bring too! Is that the way the assignment reads? Why didn't you take the time to learn to use code tags for the code in your post? PLEASE READ THE GUIDELINES to learn how to post rightly. Well first look carefully and you will see a problem with two of these: CPP / C++ / C Code:
When I compile your code ("/*Problem: ..." as line 1) I get: Code:
CPP / C++ / C Code:
Now on to 47, 48, 49 and 50: CPP / C++ / C Code:
Yours is even more descriptive: "operands of / have illegal types 'pointer to int' and 'double'" If you look at the function parameters you will see they are all pointers. What you have tries to divide a pointer by a value and store that as a pointer. That get's a big "NO WAY DUDE!" from the compiler. What you need to do instead is use the "*" operator to "dereference" each pointer (use the value stored at that address) like this: CPP / C++ / C Code:
BTW, "ammount" is spelt "amount". Last edited by Howard_L : 08-Nov-2009 at 09:15.
|
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run script command on ns2.26 | newbie06 | Computer Software Forum - Linux | 66 | 16-Jan-2010 10:53 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| template <class Data> problem, more than one data type | qboy | C++ Forum | 1 | 13-Oct-2006 16:08 |
| syntax errors in document | coder | MS Visual C++ / MFC Forum | 0 | 11-Mar-2006 04:12 |
| Simple question about while loop | Lej | C++ Forum | 6 | 07-Aug-2005 13:57 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The