![]() |
|
#1
|
|||
|
|||
NEwbie new helpCPP / C++ / C Code:
this up is the original code and contains some errors so need help and in linearSearch need add code the result should be like this Searching for -1 in numbers using linear search Number not found after 16 steps Searching for -1 in numbers using binary search Number not found after 5 steps Searching for 0 in numbers using linear search Number found after 1 steps Searching for 0 in numbers using binary search Number found after 4 steps Searching for 7 in numbers using linear search Number found after 8 steps Searching for 7 in numbers using binary search Number found after 1 steps Searching for 11 in numbers using linear search Number found after 12 steps Searching for 11 in numbers using binary search Number found after 2 steps Searching for 15 in numbers using linear search Number found after 16 steps Searching for 15 in numbers using binary search Number found after 5 steps Searching for 22 in numbers using linear search Number not found after 16 steps Searching for 22 in numbers using binary search Number not found after 6 steps thx Last edited by LuciWiz : 18-Apr-2005 at 04:58.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
|||
|
|||
|
Quote:
So: post the exact errors that you got, and tell what you did to try to fix them. Tell what compiler you are using (sometimes it makes a difference as we try to point out what the messages are really trying to tell you). Regards, Dave |
|
#3
|
|||
|
|||
|
the error occurs in the void binarysearch function in the return
they saying warning: `return' with a value, in function returning void search.c:57: parse error before `else' like that i using linux to compile it..from school CPP / C++ / C Code:
|
|
#4
|
|||
|
|||
|
Quote:
1. The "return with a value" message was from your original code (you used to have "return 1" here). 2. For the "parse error" message: get rid of the spurious semicolon on the following CPP / C++ / C Code:
Here's the context: CPP / C++ / C Code:
Regards, Dave Last edited by davekw7x : 19-Apr-2005 at 09:10.
|
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| linked lists, newbie needs help | moltarim | C Programming Language | 4 | 06-May-2004 11:32 |
| newbie using Sam's series | Skampy | C++ Forum | 3 | 06-Mar-2004 18:51 |
| Grouping data from MySQL with PHP - Newbie question. | giobbi | MySQL / PHP Forum | 12 | 27-Feb-2004 00:34 |
| Newbie Problem with cin | trs2988 | C++ Forum | 4 | 08-Feb-2004 12:05 |
| Problem with my Geforce video card | Shivs | Computer Hardware Forum | 2 | 30-Jan-2004 20:54 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The