Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:16:02+00:00 2026-05-23T16:16:02+00:00

I’m new to programming in C and I have the following situation where I

  • 0

I’m new to programming in C and I have the following situation where I know what needs to be done, I’m just not sure of the right way to do. I’ll try to keep it as simple as possible, and please let me know if I’m not providing enough info.

There’s a .h file with this line:

#define NS_CONN_ENTITYTOOLARGE    0x2000

Then in the C code we have the following flag being set:

connPtr->flags |= NS_CONN_ENTITYTOOLARGE;

Then later on this test:

if (connPtr->flags & NS_CONN_ENTITYTOOLARGE) {
}

Now what I want to do is basically “undo” the flag NS_CONN_ENTITYTOOLARGE. After some Googling I discovered that |= is a “bitwise OR”, but I don’t feel a lot more enlightened after learning that. Do I need to do a bitwise XOR, a NOT or what?

Here are all the possible values for flags that I can find in the header file.

#define NS_CONN_CLOSED        0x1
#define NS_CONN_SKIPHDRS      0x2
#define NS_CONN_SKIPBODY      0x4
#define NS_CONN_READHDRS      0x8
#define NS_CONN_SENTHDRS      0x10
#define NS_CONN_KEEPALIVE     0x20
#define NS_CONN_WRITE_ENCODED     0x40
#define NS_CONN_FILECONTENT       0x80
#define NS_CONN_RUNNING           0x100
#define NS_CONN_OVERFLOW      0x200
#define NS_CONN_TIMEOUT           0x400
#define NS_CONN_GZIP          0x800
#define NS_CONN_CHUNK         0x1000
#define NS_CONN_ENTITYTOOLARGE    0x2000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:16:03+00:00Added an answer on May 23, 2026 at 4:16 pm
    connPtr->flags &= ~NS_CONN_ENTITYTOOLARGE;
    

    This doesn’t exactly “undo” |= because it may have been a no-op for some or all of the bits in NS_CONN_ENTITYTOOLARGE, if they were already in the variable. In these case, those bits will be cleared too regardless of whether they were there in the first place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.