473,385 Members | 1,372 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,385 software developers and data experts.

Low Byte into High Byte. Bits conversion.

Please,i need help.

My problem is to change low Byte and High Byte with the help of serialization and deserialization. Frankly speaking i dont have any idea how to do it. I am sitting 3 hours already, maybe my brain was not ready for C yet :)))
Apr 1 '15 #1
4 2147
weaknessforcats
9,208 Expert Mod 8TB
Exactly what do you need to do?

When you say low byte swap with high byte do you mean an array of 4 bytes like 1234 gets changed to 4321?
Apr 1 '15 #2
I have to write a funktion which changes the places of Low Byte (Bits 0-7)and High Byte
(Bits 8-15) e.g. 0x4020 gets changed to 0x2040.
Apr 1 '15 #3
weaknessforcats
9,208 Expert Mod 8TB
Have you considered casting your number as an array of 2 unsigned char and then swapping array[0] with array[1]?
Apr 2 '15 #4
donbock
2,426 Expert 2GB
What is the prototype for this function that you're writing? Defining the prototype will specify the inputs and outputs of the function; and this should help to clarify your thinking.
Apr 2 '15 #5

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

Similar topics

15
by: jeko | last post by:
Hi, is it possible to read a double variable one byte at a time. I would want store each byte into unsigned char and then assemble again the double variable again. thanx Andrea
1
by: Wasim Akram | last post by:
Hi, I have a field "Month" in my SQL server table. The type of this field is "tinyint". Now what I am doing in the code is using DataRow to read this field in a 'int' variable. int month...
32
by: Guoqi Zheng | last post by:
I am really do not know so much about byte/bit, etc. Question, if I defined a byte(), how can I add a single byte to it? what I want is that I have an array of bytes, I loop that array, look at...
6
by: Narshe | last post by:
How can I convert a byte into a byte?? You can assign a byte to a byte?, but you obviously can't do that with an array. The way I'm currently doing it is a for loop that just copies the data...
6
by: Seabass | last post by:
Hello everyone, I'm trying to do a Hex Viewer in C#. I'm reading the user selected file byte by byte but it seems to take forever ( one minute to read a larger file ). Is there any way to make...
3
blazedaces
by: blazedaces | last post by:
I was working all day yesterday (and will probably be for most of today) with bytecode where java wrote the bytecode and matlab read it... I had never worked with bytecode in great detail before so...
3
by: efdeugenio | last post by:
Hi, I will really appreciate if someone cans help me with this: I have a managed c++ class that I am calling from C#. The declaration of a function in this class is: bool CanAddTemplate(unsigned...
6
by: Ashit Vora | last post by:
Hi, I had one small query. I 'm coping data from an unsigned short to a char*. code is #include<stdio.h> int main(void){ unsigned short type=0xFE10;
18
by: wquatan | last post by:
Does someone know an (fast) example of reading files in VBA, Byte per Byte ? I need to be able to take action on every single byte Thx
1
by: cjlee | last post by:
- API Function TestSend(ref char data, ref int len, char slot); --------------------------------------------------- Byte IccSelect = new Byte{ 0x00, ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.