No, I have to use the struct I wrote there.
I will do some functions in general but not now because I need to solve this problem for today. In 2 weeks I will have some more time to write some nice...
Type: Posts; User: juanjuanjuan
No, I have to use the struct I wrote there.
I will do some functions in general but not now because I need to solve this problem for today. In 2 weeks I will have some more time to write some nice...
Yessssssssss! That's exactly what I'm trying to do. Look:
tPerson* lastNi(tPerson* ni, tPerson* actual)
{
if((ni)!=NULL)
lastNi(((ni)->next), actual);
else{
What I'm doing is:
- I find the grandson in the list
- I put ni pointing to that node
- I eliminate it from the list but I still have it in 'ni'
- Now it comes the problem: I can't save a second...
I have a list like this, for example:
father1->son1->grandson1->grandson2->father2->son2->grandson3->NULL
I need to divide it in 3 lists like this:
father1->father2->NULL
son1->son2->NULL...
Can anyone tell me his skype or something to chat with him or her? I need to make a program that separates 1 linked list in 3 linked lists, but I can't solve one part of the problem.
The program is...
Any help, please?
I forgot to mention that in main I have this:
int main()
{
tCompany vector[5];
return 1;
}
Because this is just the beginning of the exercise. Then I have to order them by age and a lot of things more, but I suppose I can do that on my own.
That's why I'm asking you for the first part of...
This is what I'm trying to do:
13820
Hello everyone. I've been all the day with a problem and I can't fix it. I hope you can help me.
I have a company which has different areas (for example: Marketing, Sales, etc.) and each area...
I fixed everything!
I was using fread when I need to use fwrite. Thanks anduril, you're the best!!
OK, so the 2nd is correct?
This is the code:
datebook is a struct that has year, month, day, hour and minutes of the booking
in patientAux I save the patient I'm looking to eliminate
...
This is what I'm trying to do! :)
Now, I delete the node from the list but, when I print all the binary file again, it appears again! (So, I didn't delete it). To put the lists in the binary file...
I could fix it!!
Now I have another problem:
I have some nodes with information. I copy all the nodes to a binary file. Then, I delete one node and I want to have the binary files with all the...
Hello everyone. I hope you can help me because I really don't know what to do :frown:
I have to manage a Clinic. I need to delete a booking (for example, if John said he's coming on March 22nd at...
I made a lot of "drawings" in a paper about what I have to do and then I tried to solve it. What I know I have to do is to walk through a list until I find the speciality (for example: pediatric) I...
Hello everyone!
Now, I have a problem when I need to append some information to a text file: I don't know how to do it.
I open the file like this:
FILE* fpacientes;
fpacientes =...
I just fixed it. I hope I have no more questions. Thanks :D
Like I said in the first post, I can translate it in English. I didn't write the structs. In English they are:
typedef struct patient{
char* name;
char id[MDNI];
I have another question:
if I have this file for "especialidades":
1;Ophtalmologist
2;Pediatric
3;Veterinarian
I have this structs:
typedef struct paciente{
Thanks!! I read what I found about "serialization" but I only found for C#, not C. What about the fwrite you write? If you can give me some more information, it would be great.
:D
Well, now this is really better. It works fine. The loop while(!feof) is not anymore and now it's while(fscanf(...)!=EOF) :biggrin:
From yesterday I'm trying to write in a binary file (.dat) some...
I read and try to solve everything with all the things you tell me. I tried to fix the "!feof" because I read and understood this: FAQ > Why it's bad to use feof() to control a loop -...
That's true, but I was told that it's better if I write everything because I can do it more "automatically". I know a lot a people say that (char*) before malloc is wrong, but it's just to remember...
- Not using while(!feof): I think I understood how to do it, but I will correct that when the program works fine, so I know I don't have an error in that part of the code.
- Casting realloc: that's...