Thank you IMalc, I got that. :)
Type: Posts; User: nynicue
Thank you IMalc, I got that. :)
Yes it is a homework, I didn't do coding, just wrote an algorithms.
You are right I have to try them myself, thank you.
Hi, can anyone please take a look at these algorithms. Are they correct? Are they going to work?
Thank you
Algorithm for the linked list implementation of the following for simple lists.
...
thank you, and I just understood I also don't need to malloc hte space for KEYS k, as a head node already passed to the function, I only need to malloc for k->next
Thank you. I used fseek() before ftell()
THis how I changed it , I decided to use do while instead of for loop, but it still not working, it loops though the loop, but I don't see any data that...
Thank you , I just checked.....I putted printf's after each line to see where program crashes , and it do that on if(ftell(fp)==NULL) line, on this line I was checking to see if the file is emty. ...
Thank you for the reply Adak , stdlib.h doesn't change anything......in the main fn delcared as char fn[CHARS];......I am sorry but can you explain what cast the resolts of malloc() means?
Hello, I am working on function that builds the linked list of nodes, program exits when it comes to the line where file needs to be opened. don't understand why? To the function I am passing...
Ooo I got this now, thank you. Can I ask what 'z' means in there
for(cur=head; curr!=NULL; cur = cur->next)z
Thank you Cooloorful , now I see where problems were .
It was very helpfull.
...
I don't really understand. I am using strcmp to compare names in list1[index1] and list2[index2] at index 0 for alphabetical order , assume that list1[] goes first so, index1 now at index 1 and...
This is an assignment and we have to read file into char arrays and then put then into linked list and then write them back into the same file, the file looks like
Ariel, Brooks ...
I checked it doesn't return a null pointer.
OK the problem is in a while loop (post #3) first if statements always skips and then it goes to the second if , and I don't understand why. Given to us file already sorted , but we still need to do...
Thank you.
The problem did not go away yet :(
.
Sorry, I think the problem is in this loop
while(index1<=count||index2<=count)
{
curr->next=(Node*)malloc(sizeof(Node)); /*allocate space for next node*/
curr=curr->next; ...
Hi everyone. I am having a trouble with linked list program. This program will read a file with names and store them in a two lists. Then I need to make a linked list and then write them back to the...
Are you sure & needs to be there?
you can use %f insetead of your %.2f or %s and then convert it to float. I think it sould work.
and also
you can't do that
and
all those addresses should not be there when you scanf into the strings
I have all files copied in the derictories in my Debug folder, I am using visual Studio C++ 2008
And what if I am open my master file read an year and open corresponding one of the 12 files to...
Almost
want.names- master file , contains data for n amount of years,
1975 year
156 Smith
123 Mccarthy and so on , then another year
This file was created long time ago...
dwks, I tried, it did not fix the problem, I think the problem is not in a file name, it somewhere else
Forgot to tell, name of files come from commad line.
that is why I have:
year=atoi(argv[i]);
sprintf(fn,"topps.%2d",year); // this name of the file
I think I am getting it ( can't check that out yet, still can't open files).:
while(fgets(topps_file, 4, f1)!=NULL)
{
while(fgets(wants_file, 4, f2)!=NULL)
if((str=strcmp(topps_file,...
I tought with fgets I would put contents of the whole file into something, or I am just lost.
all files I have in a directory, /want.names have no problem to open, but files taht have to...