473,796 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set and reset the least significant bit of a address

I want to set and reset the least significant bit of a address (where a
pointers points to).
I tried this, but it is not correct:
#define BIT 0x1

void foo(){
void *p;
*p = *p & ~BIT
}
Nov 14 '05
52 7075
no*@given.out wrote:
On Sat, 19 Mar 2005 18:25:44 GMT, CBFalconer <cb********@yah oo.com> wrote:

no*@given.o ut wrote:

... snip ...
I don't bemoan the urge for some regulation. It's necessary to
keep any newsgroup from degenerating into simple chaos... but
where does one go to discuss progress in the language?


Try comp.std.c.

Ummm... lets see if I'm getting this...

In comp.lang.c one is only allowed to discuss standardized C.
However, in comp.std.c one is only allowed to discuse non-standard C

Isn't that backwards?


comp.lang.c is where we discuss using the C language, comp.std.c is
where the C standard, including possible future direction, is discussed.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 14 '05 #51
no*@given.out wrote:
Chris Croughton <ch***@keristor .net> wrote:
.... snip ...
Looking for Pelles C using Google, I see that it's another one
based on LCC as is Mr. Navia's compiler, so that should be on
topic on comp.compilers. lcc as well.
Apparently not.


Oh? I have seen nothing from you on comp.compilers. lcc. I have no
idea whether or not Pelles C is a member of the lcc family, though.
If you want to discuss standard C, however, as it is and not as
some language you might like to use which isn't C, you're
welcome to do so here...


Apparently not.


And I have seen no discussion of the use of standard C from you
here. Just complaints about topicality. Try it, you might like it
(portability).

--
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
Nov 14 '05 #52
In article <42************ ***********@new s.wanadoo.fr>,
ja***@jacob.rem comp.fr says...
no*@given.out wrote:
Unlike a lot of other newsgroups it seems people here play along with this
ultra-narrow focus, even though there really doesn't seem to be a general
purpose C discussion group anywhere on Usenet.


There is the minority view. I have received a lot of flames because of
this, but I go on believing that this group should discuss C beyond the
"portable" stuff.


What does "beyond the portable stuff" mean to you Jacob? One might
guess that it means writing a function (or library) that only works
on one, or a few platforms. I suspect though that in your case it
means writing a compiler, that works (sort of) on one platform, and
that doesn't resemble C much at all anymore. Why would anyone, but
you, wish to spend time discussing such narrow extensions to the
language, especially when comp.compilers. lcc seems to be the natural,
perfect place for a discussion of that narrow topic?

--
Randy Howard (2reply remove FOOBAR)
"Making it hard to do stupid things often makes it hard
to do smart ones too." -- Andrew Koenig
Nov 14 '05 #53

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7756
by: Eric Kincl | last post by:
Hey, I was wondering if it's possible to reset the "auto_increment" feature in MySQL. For example, if I have a database with a list that will change every year (the old list be completely flushed out, deleted) and then I insert a new list, it will very quickly reach the max INDEX length... Does it just wrap itself? Is there a way to reset "auto_increment" so that I can flush all the rows, reset auto_increment, and start from scratch? ...
4
11195
by: Donnal Walter | last post by:
On Windows XP I am able to connect to a remote telnet server from the command prompt using: telnet nnn.nnn.nnn.nnn 23 where nnn.nnn.nnn.nnn is the IP address of the host. But using telnetlib, this code returns the traceback that follows: import telnetlib host = 'nnn.nnn.nnn.nnn'
16
20534
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case of this file, the auto number field serves no useful purpose except as an
8
2178
by: spike | last post by:
My prygram goes through a string to find names between '\'-characters The problem is, parts of the name in sTemp remains if the new name is shorter than the old name. code --------------------------------------------------- char sTemp; char sText = "THELONGESTNAME\\samantha\\gregor\\spike\\..."; // and so on...
20
9180
by: GS | last post by:
The stdint.h header definition mentions five integer categories, 1) exact width, eg., int32_t 2) at least as wide as, eg., int_least32_t 3) as fast as possible but at least as wide as, eg., int_fast32_t 4) integer capable of holding a pointer, intptr_t 5) widest integer in the implementation, intmax_t Is there a valid motivation for having both int_least and int_fast?
0
1434
by: Larry Serflaten | last post by:
I recently fired up VS2003 while online which I have done on numerous occasions before. When I opened the toolbox, ZoneAlarm popped up a box saying the IDE wanted to access the internet. This was the first time it tried to connect to the internet, that I can recall, and it was to some address I did not recognise, so I denied it. VS hung, and when I tried to kill the process (Task Manager) all my desktop windows went into tiled view...
3
18749
by: kashif_khan | last post by:
hi everyone, can anybody please tell me why reset button is not working in the following code, i tested it in opera, firefox and konqueror, <form action='edit_links.php' method='POST' name='save_links' id='save_links'> <table cellpadding='5'>
4
7977
by: thegeneralguy | last post by:
Hello, I'm trying to find the least significant set bit (i.e. the first '1' bit in an int) through just bit twiddling, but I can't get it without resorting to a loop. My original idea was to reverse the bits in an int and find the most significant bit then subtract it from 31 to get the position of the LSB. Is there a way to get the LSB of an int using just bit manipulations? e.g., 0b0101 would return 0001, 0b0000 would return...
2
3205
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears out of the text box, but the meter will stay at its current position until text is entered back into the textbox. Once text is re-entered, the meter will display the results again. I would like everything to reset when the button is pushed, but I...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.