[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 !



On Wed, 1 Sep 1999, Joachim Holst wrote:

> Hejsan !
> 
> Det finns en liten operator som heter =~. tyvärr, så har jag ine kommit
> fram til lvad den gör. Någon som kan hjälpa till med ett exempel eller två

øh, den findes ikke i C, er du sikker på du ikke mener Perl?

~ i C vender bitsene på et tal, so du kan sige X = ~Y (men = og ~ er altså
helt seperate her).

Oftest benytter man den i sammenhæng som:

#define BIT 1 << 10 
bits &= (~BIT)

Hvor man altså and'er med alle bits udover BIT, som så sætter BIT bitten
til 0.



-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>         (not speaking for) DDE
==============================================================================



 
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] *