In a file called itemADT.c I have specified the itemType data type to contain a listADT (having already written this library) and an integer, which will eventually represent the no. of times the word that is stored in the listADT has occurred (when I do this, and write code to insert itemTypes into a binary tree).
I know my listADT.c code and listFuns.c code works fine because I have tested this separately, but when running the program below (itemADTtest.c), that calls functions from itemADT.c (also shown below), I'm not getting the correct results - I think the problem must lie within the buildItem method, but I'm not sure. buildItem calls the stringToList method from the listFuns library, which creates and returns a listADT containing the letters in the str[] array passed into it. It is then supposed to assign the tempList created in the method to the 'word' part of the itemType, and assign a value of 1 to the count integer of the itemType - then return the itemType.
When I run the test program, both of the test itemTypes are shown to contain the same word (when one should contain 'rat' and one 'rag', although these would be the wrong way around as I've not included a 'reverse' method), but instead, when I try to print item1 and item2 to screen they are both shown as containing the word 'rag'? (or 'gar' to be exact as it's backwards)...
I've included a call to displayList within the buildItem method to show what the temporary lists are created contain, and this shows they are creating the correct words, so I'm thinking the problem must be either in the last few lines of the buildItem method within itemADT.c or in my test program...
Sorry for the long post, I'm still a beginner to C... but any help would be much appreciated!
1) The lpr and sort utilities accept input either from a file named on the command line or from standard input.
a)Name two other utilities that function in a similar manner.
b)Name a utility that accepts its input only from standard input.
2) Explain the following error message. What... (10 Replies)
1.) I am to write scripts that will be phasetest folder in the home directory.
2.) The folder should have a set-up,phase and display files
I have written a small script which i used to check for the existing users and their password.
What I need help with:
I have a set of questions in a... (19 Replies)
Hey all,
Thanks for all the help you have given me. Two more things I am trying to figure out.
I need to issue a command..example
ps -ef | grep <process>
This would return about 10-15 running processes. I need to verify that there are x amount of processes running. What is... (7 Replies)
Hi All.
I have a package discreibed down.
CREATE OR REPLACE PACKAGE BODY IRISCOS_REFRESH_pkg AS
PROCEDURE IRISCOS IS
CURSOR cur_pci(c_myear number)
IS
Select cstc.cid, cstc.elid, p.first_name,p.last_name,p.email_id ,pl.plan_name, ptc.chair_id
from
person p, person_to_chair ptc,... (7 Replies)
I need script to convert many files of the format MPEG ADTS to a normal mp3. (because my net radio can't play ADTS, for example:
file plik.mp3
plik.mp3: MPEG ADTS, layer III, v1, 128 kBits, 44.1 kHz, JntStereo
not play
file beautiful.mp3
beautiful.mp3: Audio file with ID3 version 23.0 tag,... (6 Replies)
Hello,
First of all, i want to say Hi! Glad to join your forum and be your member. I'm a newbie towards C/C++ especially on network programming.
What is the definition of getaddrinfo()?
int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
... (4 Replies)
Hi guys. I'm writing a basic script in C# and there's a few areas where I am stuck, and I was wondering if you may be able to help me?
1) Can you embed an image into the source code so it will show in the windows GUI?
2) Can you change the background of the GUI?
3) How do you add an .ico to... (5 Replies)