[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
 

CPP makro med variabelt antal parametre?



Kan man lave en cpp makro med variabelt antal parametre?
f.eks. noget der wrapper printf ?

altså kan jeg lave en oneliner i stedet for at skrive

#define WRAPPER1(s,a) printf(s,a)
#define WRAPPER2(s,a,b) printf(s,a,b)
#define WRAPPER3(s,a,b,c) printf(s,a,b,c)

Idé:
Kan jeg f.eks. tvinge makroen til at opfatte alt mellem parenteserne som ét argument, noget i retning af:


#define WRAP_PRINTF(s) printf(s)

men hvordan?
kommaerne i printf udtryk, får jo makroen til at opfatte s som flere argumenter?


/ Kristian

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-11-01, 02:01 CET [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] *