So have you any ideas on how to solve the problem as defined above?
Type: Posts; User: Dangerous Dave
So have you any ideas on how to solve the problem as defined above?
Hi all,
Here is the prob, i have a .txt file containing the following lines there are currently 5 lines but it can keep growing and growing in size.
I want to be able to read the last 5 lines...
The siftUp Function does not work at the moment. Its Function is to sift upwards through the heap until it finds a higher value than its current arguement. The insert function calls to the siftUp...
You will be writing heap code where the heap priority is no longer decided by a
simple key value. Instead the key value of a node will be an index into an array of
pointers to data structures, and...
Ok i just got the code working, so i take it what you guys were saying is dont use 3 files use 2. I got rid of the heapTest1.cpp and pastes all that code into the heap.cpp file. I then removed the...
Ok,
I got the spelling error in the #define and changed main() to return a int.
I dont understand what you maen by include the .h file as i dont have any .h files. i have 2 .cpp and a .hpp. And...
hi there,
I have writeen these three files from notes given in class and by taking bits and peices from books and online. I am compiling these in borland 5.01 and im getting an error saying:
...
This is what im going to run with now i think. Thanks For all the help guys.
do
{
printf("Please Enter Your Choice From The Menu: \t");
error = scanf("%d%c",&menu_choice, &c);
...
Currently if this code is run and the user inputs the number 1 or 2 followed by any amount of characters it will take the value 1 or 2 and run. I would like ths case (Number,Char) to be returned as...
Hi,
Thanks for all the help so far. Any more sugestions would be greatly appreciated.
Thanking you.
#include <stdio.h>
May i point out that your simpson quote is incorrect.
u have:
Simpson, Homer Simpson, hes the greatest guy in his-tor-ey! From the, town of brigfield, he's bound ot hit a tree! - as said by...
for(i=0; i <= SIZE - 1 ; i++)
for(j =0; j <= SIZE - 1 ; j++)
{
while(strcmp(book_array[i].name, book_array[j].name) < 0)
{
strcpy(hold, book_array[j].name);
...
Why???
a ^= b ^= a ^= b
is the same as
a ^= b
b ^= a
a ^= b
which can be written as
JOKE!
void add_a_book (BOOK book_array[])
{
int i=0;
while ( book_array[i].number != 0 && i < SIZE )
{
i++;
while ( i < SIZE && strcmp(book_array[i].name, book_name) != 0)
i++;
should that do the trick?
in the while loop i am comparing a string with logic opperators, what else can i do?
void search_title (BOOK book_array[])
{
int search_database();
char book_name[SIZE];
int pos, i ;
printf("Book Name to Display (max 20 chars) :");
scanf( "%d",&book_name );
did i not say i knew that was the address and i was just testing everyone. thanx for the help man.
well done on 1k posts.
the last line of the code simpley prints out the value stored in status.
but it does not for some reason.
void add_a_book (BOOK book_array[])
{
int i=0;
while ( book_array[i].number != 0 && i < SIZE )
{
i++;
}
void add_a_book (BOOK book_array[])
{
int i=0;
/* Search the array for an empty position.
An empty position has a 0 for the book number */
while ( book_array[i].number != 0 && i <...
Try running the program a few times in a row. this may cause the program to crash. it should not work but it writes over memory if should not have access to so better to use the right sized arrays.
would i be correct in saying that the scanf function returns a value of 0 if the correct input has been entered and a value of 1 if incorrect input has been entered??
and if so how would i check...