Here is the question....Write a statement that declares a prototype for a function divide that takes four arguments and returns no value. The first two arguments are of type int . The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value.
Here is my code - void divide(int , int, pInt* quotient, pInt* remainder);
But it doesn't work! What am I doing wrong? Thanks in advance guys!
5 8473
Here is the question....Write a statement that declares a prototype for a function divide that takes four arguments and returns no value. The first two arguments are of type int . The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value.
Here is my code - void divide(int , int, pInt* quotient, pInt* remainder);
But it doesn't work! What am I doing wrong? Thanks in advance guys!
Off the top of my head I'd say that looks right (you might consider trying to put variable names in the int places, or taking them out of the quotient/remainder, but that also looks like a function declaration, in which case I didn't think it mattered...), can you post the entire code you are using?
Off the top of my head I'd say that looks right (you might consider trying to put variable names in the int places, or taking them out of the quotient/remainder, but that also looks like a function declaration, in which case I didn't think it mattered...), can you post the entire code you are using?
Well, its a website where I input information/codes and it tells me if it a correct. So I don't have the whole code just the question. Sorry.
Well, its a website where I input information/codes and it tells me if it a correct. So I don't have the whole code just the question. Sorry.
Ah, I got it to work. It ended up being void divide(int a, int a, int* quotient,int* remainder);
I had my doubts about pInt* - I don't think that's even a supported type. int* would have been correct.
Glad to see you got it!
And just so you are aware - void divide(int a, int a, int* quotient,int* remainder); uses the same variable name in two different places. When you try to access one of the ints, you will not be able to get the value inside the function - you will only get one, I'd recommend changing it to either a descriptive name or 'b' or something.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: James Marshall |
last post by:
I'm writing a library where I want to override document.write(), but for
all document objects; thus, I want to put it in the prototype. I tried
...
|
by: Ben |
last post by:
Hi all,
Just wondering how to write (using document.write) to a table cell. I
have table with 3 rows and 3 colums. I want to write from within...
|
by: Roy Hills |
last post by:
I've seen two different function prototype formats used for ANSI C,
and I'm unsure as to which is the correct or preferred one.
1st Format (this...
|
by: Thierry Loiseau |
last post by:
Hello all,
and Happy end year 2005 !
Well, I would like to obtain a list of all JavaScript var statement,
With "for...in" perharps ?
That...
|
by: eman1000 |
last post by:
I was recently looking at the prototype library
(http://prototype.conio.net/) and I noticed the author used the
following syntax:
...
|
by: Vince Castellano |
last post by:
Hello,
I have a set of DLLs that implement different configurations of the
same API. Consider them as first.dll, second.dll, and third.dll. They...
|
by: jonniethecodeprince |
last post by:
Hi all,
I was wondering if anyone could help me display the HTML in a javascript that displays a table of data of prototype cinema listings.
...
|
by: Break2 |
last post by:
I am trying to write a simple program which asks a user to enter 5 integers after which the average will be computed and written to the screen. That...
|
by: June Lee |
last post by:
Is that for Class/Object function prototype, I must define the
function in header file or .cpp file.
MyClass::functionA();
MyClass::functionB();...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
| |