Sponsored Content
Top Forums Programming How bit representation of a number can be done in c? Post 302902214 by ezee on Monday 19th of May 2014 12:40:19 PM
Old 05-19-2014
How bit representation of a number can be done in c?

I have an assignment in which a character is the input of which some bits(from a position to certain position) are to be inverted (1's complement) and then the resultant character is to be returned....for example

Code:
unsigned char x = J      from p = 3  to offset n = 5

01001010 inverted to 01110100

't' is the output

Thanks

Last edited by jim mcnamara; 05-19-2014 at 05:29 PM..
 

5 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Shell Programming and Scripting

Help needed in converting number to bit

Hi, I have the following file input:- 542 4795 61 543 4795 61 544 0 0 545 292 ... (5 Replies)
Discussion started by: ahjiefreak
5 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. Programming

Number to bit vector

Is there a function to convert number (unsigned int for this example) to binary? I could not find a simple one thru google. While I was learning bloom filter with the example, I was wondering if anybody can help me to 1) display the real bits vector for the bloomfilter; 2) if dataset is very... (11 Replies)
Discussion started by: yifangt
11 Replies

5. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
XmTextPosToXY(3X)														 XmTextPosToXY(3X)

NAME
XmTextPosToXY - A Text function that accesses the x and y position of a character position SYNOPSIS
#include <Xm/Text.h> Boolean XmTextPosToXY (widget, position, x, y) Widget widget; XmTextPosition position; Position *x; Position *y; DESCRIPTION
XmTextPosToXY accesses the x and y position, relative to the upper left corner of the Text widget, of a given character position in the text buffer. Specifies the Text widget ID Specifies the character position in the text for which the x and y position is accessed. This is an integer number of characters from the beginning of the buffer. The first character position is 0. Specifies the pointer in which the x position, relative to the upper left corner of the widget, is returned. This value is meaningful only if the function returns True. Specifies the pointer in which the y position, relative to the upper left corner of the widget, is returned. This value is meaningful only if the function returns True. For a complete definition of Text and its associated resources, see XmText(3X). RETURN VALUE
This function returns True if the character position is displayed in the Text widget; otherwise, it returns False, and no x or y value is returned. SEE ALSO
XmText(3X) XmTextPosToXY(3X)
All times are GMT -4. The time now is 12:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy