[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] bitskifte ?



Hejsa,

Jeg sidder lige og prøver at følge med i jeres diskussion;
> Tjoh, hvis du har nogle bits:
> #define OPEN (1 << 0)
> #define LOCKED (1 << 1)
> #define TRAPPED (1 << 2)
> int status = OPEN|LOCKED|TRAPPED;
> Og nu vil du fjerne OPEN bitten fra ovenstående så skriver du:
> status = status & (~OPEN)

Hvad betyder de første tre definitioner (?): at du sætter bit 0,1 og 2 hhv.
til 1 eller hvad? Jeg har ikke stiftet bekendskab med "<<" operatoren før.

Mvh,
 Martin


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 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] *