[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Pointer til void functioner



Tak for svaret, men det var ikke helt det jeg mente.

Jeg har et program, som kan udføre forskællige ting. Functionerne kunne f.eks.
hedde:
addUser()
delUser()
modifyUser()


En anden function skal uden at vide hvilken af disse tre funtioner som er
aktive, kunne koble dem af hvad de gør.
Dette med en egen lavet function hedder releaseFunc.
Denne kunne så hedde:
releaseFunc( addUser(), doIt() );
releaseFunc( delUser(), doIt() );
releaseFunc( modifyUser(), doIt() );

Jeg ville så bare gerne kunne kalde releaseFunc( "pointer to function", doIt()
);
Jeg kunne lave en enum eller lign, som holdt styr på hvilken function som var
aktiv, men det ville gøre det besværligt idet jeg tilføjer functioner.
(En masse switches, if'er o.lign.)

Tak igen





 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *