![]() |
|
#1
|
|||
|
|||
passing parameteri have a prog by input a number then after press ENTER the output is value of the number.if the number 0 then exit the prog
output: input a number: 4 value:4 CPP / C++ / C Code:
but as i get the result,the passing doesn't work. what cause the passing parameter can't run? |
|
#2
|
|||
|
|||
|
were you able to complie it ? I see one mistake in function view()
CPP / C++ / C Code:
where does this variable "no" come from.? Its not declared inside view() and the one in main() is local to main() and not global. Hence you can not access it inside. You are trying to assign a non-existent variables value to variable a. My guess is ( sorry, if its not as good as yours ;-) ), this is what you intended to write, CPP / C++ / C Code:
Thanks, |
|
#3
|
||||
|
||||
|
CPP / C++ / C Code:
I suppose that would work too __________________
People should read the rules and regulation before posting! The Best is yet to be... |
|
#4
|
||||
|
||||
|
Ar actually, i think you are confused over functions parameter passing
CPP / C++ / C Code:
in short, U dont have to match parameter names exactly. U dont have to return a value labelled as 'a' to a function that has 'a' as its parameter declaration. __________________
People should read the rules and regulation before posting! The Best is yet to be... |
|
#5
|
|||
|
|||
|
Quote:
There are several bugs in the code that you posted that prevent the code from compiling on anything that I can imagine. They are fatal, guaranteed-not-to-compile-with-any-compiler bugs. 1. If the code that you posted is not exactly the code that you compiled, then no one can help you understand your problem. Paste your code into the message; don't retype. 2. If the code that you posted is exactly the code that you compiled, please tell us what compiler you used. (We still may be able to help you, but I would like to know this.) When you say "the passing didn't work" you should tell us exactly what you got, and why you think it should have been something else. 3. If your code didn't compile, then look at the compiler's error messages. Fix the code so that it compiles. If you can't figure out what the error messages mean, then post the error messages exactly as the compiler gave them to you (paste the exact error message; don't summarize). Maybe we can point out how to interpret the compiler's error messages, so that you can understand what it's trying to tell you. Regards, Dave |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble passing STL into a function | Clive73 | C++ Forum | 5 | 10-May-2005 19:00 |
| Finding the memory address of a pass-by-reference parameter? | ScottLewis | C++ Forum | 1 | 30-Apr-2005 12:13 |
| parameter passing? | jheron | C++ Forum | 15 | 02-Mar-2005 06:04 |
| Passing referance and passing pointer | Poolan | C++ Forum | 6 | 29-Oct-2004 08:18 |
| cannot convert parameter error on DrawTextA | ozzytx | MS Visual C++ / MFC Forum | 1 | 22-Sep-2004 03:45 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The