Thread: comparing octals???

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    103

    comparing octals???

    I'm taking a permission number and outputting it as an octal

    Code:
     (0777 & perm)
    and I want to compare it with the permission number '777' but I don't know how to compare these two. Anyone?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You say you want to compare "it". By it, do you mean perm, or (0777 & perm)? And what's wrong with using == (or < or whatever)?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-29-2009, 10:13 AM
  2. Problem with comparing strings!
    By adrian2009 in forum C Programming
    Replies: 2
    Last Post: 02-28-2009, 10:44 PM
  3. bit vs bytes when comparing a file
    By Overworked_PhD in forum C Programming
    Replies: 6
    Last Post: 05-19-2007, 11:22 PM
  4. comparing problem
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 03-05-2002, 06:19 AM
  5. comparing struct members
    By breed in forum C Programming
    Replies: 4
    Last Post: 11-22-2001, 12:27 PM