Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Linked lists in QM
#1
Hi Gintaras, hi all,

i'd like to have some information to mimic linked lists in QM.

I replaced struct by type in QM

type Node int'nombre Node*suivant
type Liste Node*premier
Liste* Head=sub.Init

#sub Init
function'Liste* 
Liste* liste=malloc(sizeof(Liste))
Node* element=malloc(sizeof(Node))
if(liste==0 or element==0) ret
element.nombre=0
element.suivant=0
liste.premier=element
ret liste


I'm quite bothered by two things:

1.  In C, all pointers to struct are initialized to NULL for safety, and this does not exist in QM, so how
convert the QM declaration 

2. are malloc, calloc and free used the same in QM and C? I ask this because i need to know how free memory safely.

Some other questions are in mind but i want to start with those.

Thanks


Messages In This Thread
C Linked lists in QM - by ldarrambide - 02-03-2019, 05:31 PM
RE: C Linked lists in QM - by Gintaras - 02-03-2019, 05:51 PM
RE: C Linked lists in QM - by ldarrambide - 02-03-2019, 06:07 PM
RE: C Linked lists in QM - by Gintaras - 02-03-2019, 06:31 PM
RE: C Linked lists in QM - by ldarrambide - 02-04-2019, 04:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)