![]() |
|
#1
|
|||
|
|||
Please Help, problems writing c program REVISEDCPP / C++ / C Code:
Last edited by dsmith : 02-Mar-2004 at 21:54.
|
|
#2
|
|||
|
|||
|
I can compile this code but when i execute it I get the following error:
--------------------Configuration: 3rd group project - Win32 Debug-------------------- Linking... 3rd group project.obj : error LNK2001: unresolved external symbol "float __cdecl findLarge(float)" (?findLarge@@YAMM@Z) 3rd group project.obj : error LNK2001: unresolved external symbol "float __cdecl findSum(float)" (?findSum@@YAMM@Z) Debug/3rd group project.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. 3rd group project.exe - 3 error(s), 0 warning(s) |
|
#3
|
||||
|
||||
|
How many threads are you planning on creating for this one program? Three so far! Please continue posting questions about the same program in the first thread (and only) you start. And don't forget to surround your code (top and bottom) in [C] / [/C] tags
|
|
#4
|
||||
|
||||
|
Hi again soulfly.
A couple of things to keep in mind. Don't post duplicates threads please. Also, once you start a thread, just reply to it if it is the same topic. And lastly, when you post code, if you sorround it by [c] and [/c] it will highlight the code and make it much easier to read. Thanks. Now on to the task at hand. Your errors are coming because you declare your functions as one thing, but then define them as something else. For example: CPP / C++ / C Code:
CPP / C++ / C Code:
Also, you need to reread the other post I sent to you. C cannot pass back more than one value. Your statements of: CPP / C++ / C Code:
|
|
#5
|
|||
|
|||
|
Here's a debugging suggestion (now that you say that your program compiles
successfully): First make sure that you are reading each number OK. That is, just after the scanf() statement put in a printf() statement to print out its value, and see if it is what you entered. Once you have verified correct data entry, proceed to the next step in your logic. Good luck! Dave |
|
#6
|
|||
|
|||
|
Quote:
By the way, the program you posted here has several errors that prevent successful compilation on any standard compiler. What compiler are you using? Dave |
|
#7
|
||||
|
||||
|
I just read the header of your code.. it says that this is a group project from a book... I'm just going to guess that this is an assignment for a class. I would strongly suggest that you start taking notes and paying more attention during lecture, as well as supplementing your studies with your book, because you are missing some of the fundamental basics of C programming. I could just as well point out every problem in that program and tell you exactly how to fix it and why it should be that way, but you probably wouldn't learn anything if I did that. So, talk to your instructor and ask for help on certain aspects of your code, or consult a book for syntax help. This forum responds much better to problems that require thinking. This is just a general syntax problem that you can figure out by studying. Look at dsmith's post for a couple rules about C programming, and davekw7x's post for a general tip on writing programs in C.
|
Recent GIDBlog
Developing GUIs with wxPython (Part 2) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Chaintech Geforce 5600 FX problems | bartster74 | Computer Hardware Forum | 8 | 04-May-2004 13:16 |
| Please Help, problems writing newbie c program | soulfly | C Programming Language | 14 | 04-Mar-2004 15:16 |
| compiling a program within another (C++) | Siphiro | C++ Forum | 5 | 06-Feb-2004 15:35 |
| error during program | rjd72285 | C++ Forum | 0 | 11-Nov-2003 18:49 |
| one program access another? | dgoulston | C++ Forum | 1 | 07-Oct-2003 11:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The