Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct lista
- {
- char *tablica;
- struct lista *next;
- } *head = NULL;
- struct pierscien
- {
- struct pierscien *next;
- struct pierscien *prev;
- int hasz;
- struct lista *argument;
- } *root=NULL;
- void dodajPierscien(int hasz, struct lista* argument, struct pierscien* root)
- {
- if (root != NULL)
- {
- struct pierscien *ostatni, *nowy;
- ostatni = (struct pierscien *) malloc(sizeof(struct pierscien));
- nowy = (struct pierscien *) malloc(sizeof(struct pierscien));
- ostatni = root;
- while (ostatni->next != NULL) ostatni = ostatni->next;
- ostatni->next = nowy;
- nowy->argument = argument;
- nowy->hasz = hasz;
- nowy->next = NULL;
- nowy->prev = ostatni;
- }
- else
- {
- root->argument = argument;
- root->hasz = hasz;
- root->next = NULL;
- root->prev = NULL;
- }
- }
- void dodajListe(char* tablica, struct lista* head)
- {
- }
- int haszuj(char *tablica)
- {
- printf("%s", tablica);
- };
- int main()
- {
- head = (struct lista *) malloc(sizeof(struct lista));
- head->next = NULL;
- head->tablica = NULL;
- root = (struct pierscien*)malloc(sizeof(struct pierscien));
- root->next = NULL;
- root->argument = NULL;
- root->hasz = -1;
- char *tablica;
- tablica = (char*) malloc(200);
- strcpy(tablica, "HELLO");
- haszuj(tablica);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement