473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Multiline Macro

Hi All,

I want to implement a macro which will toggle a bit in a byte.The user will give input from keyboard.

toggle(number,bit to be toggled)
Number,bit to be toggled will be input from keyboard.

eg:-suppose user want to toggle 2nd bit of a 8 bit number 10010011.

Then have to implement the macro toggle(10010011 , 2)
Apr 15 '08 #1
4 3993
weaknessforcats
9,208 Expert Mod 8TB
Wrtite the code to do this and then convert it to a macro.

I assume you are coding C because C++ uses a bitset object for this.
Apr 15 '08 #2
Wrtite the code to do this and then convert it to a macro.

I assume you are coding C because C++ uses a bitset object for this.

yes I'm coding C.I don't know the syntax for multiline macro.
Apr 15 '08 #3
Could anybody write the code systematically.
Apr 15 '08 #4
weaknessforcats
9,208 Expert Mod 8TB
Here you go. Use the \ as the continuation character.

#define DOIT(x,y) int z = x + y;\
printf("%d\n", z);

int main()
{
DOIT(3,4);
}
Apr 15 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rasmus Fogh | last post by:
Dear All, I need a way of writing strings or arbitrary Python code that will a) allow the strings to be read again unchanged (like repr) b) write multiline strings as multiline strings instead...
5
by: Hal Styli | last post by:
Hello, can someone please help with the following attempt at defining a macro ... I want to wrap the following in a macro:- if HEAD is defined then head=p; define HEAD else tail->next=p;
7
by: Joel Finkel | last post by:
Folks, I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry. The...
8
by: Konrad | last post by:
Hello, Stupid question, but I just don't remember, here is what I want to do: #ifdef _UNICODE #define ONLY_UNICODE(t) t #else #define ONLY_UNICODE(t) #endif You know what it does, but I'm...
40
by: Edward Elliott | last post by:
At the risk of flogging a dead horse, I'm wondering why Python doesn't have any multiline comments. One can abuse triple-quotes for that purpose, but that's obviously not what it's for and doesn't...
9
by: John Salerno | last post by:
How do you make a single string span multiple lines, but also allow yourself to indent the second (third, etc.) lines so that it lines up where you want it, without causing the newlines and tabs or...
3
by: Masa Ito | last post by:
I am trying to capture the contents of a function with Regex. I am using Expresso to test (nice - thanks for the great tool UltraPico!). I can handle my own with single line regex's (I think).. ...
6
by: Zdenek Maxa | last post by:
Hi all, I would like to perform regular expression replace (e.g. removing everything from within tags in a XML file) with multiple-line pattern. How can I do this? where =...
2
by: King | last post by:
Is there any other way to define multiline text in a XML file: <Help><!]> </Help>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.