Thread: xor (was fgets)

  1. #1
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Code:
        101011
    XOR 110101
        ------
    i think it's

    100001


    just thought i'd post something completely random because this topic is boring.

    im a retard

    i think its 11110
    Last edited by Brian; 08-18-2002 at 07:43 PM.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >i think its 11110
    011110

    -Prelude
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Okay, can someone please clarify how XOR works?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Okay, can someone please clarify how XOR works?
    If both of the bits compared are the same then the resulting bit is 0, if the bits being compared are different then the resulting bit is 1.
    Code:
        101011
    XOR 110101
        ------
        011110
    
    0 ^ 0 = 0
    1 ^ 1 = 0
    1 ^ 0 = 1
    0 ^ 1 = 1
    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fgets not working after fgetc
    By 1978Corvette in forum C Programming
    Replies: 3
    Last Post: 01-22-2006, 06:33 PM
  2. problem with fgets
    By learninC in forum C Programming
    Replies: 3
    Last Post: 05-19-2005, 08:10 AM
  3. problem with fgets
    By Smoot in forum C Programming
    Replies: 4
    Last Post: 12-07-2003, 03:35 AM
  4. fgets crashing my program
    By EvBladeRunnervE in forum C++ Programming
    Replies: 7
    Last Post: 08-11-2003, 12:08 PM
  5. help with fgets
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 10-17-2001, 08:18 PM