61 Topics
| |
Hello, I'm trying to represent the system date in a sequence such as: dd mm yy yy So far i got: dd mm yyy so, the year is represented on 2 ytes, but I only have 3 characters, i need to split after the first character and then add a … | |
I have a problem when adding 2 numbers in assembly because we are using hex. When add 4+5 (34h + 35h) the output is 9 but if I add 5+5 (35h + 35h) the output displays colon(:) or 3ah instead of 10. Here's the sample image when i generate the … | |
Hi, Is it possible to take the input from a textbox that's in chinese (unicode) and convert it into hex to output to a text file? Any insight would be great, thanks! | |
Never mind, I found out. :) | |
Hey guys, it's been a while since i've had to do any assembly programming but it's come up again in a course of mine to haunt me :p We're trying to simulate reverse polish notation, which is fairly simple..and all we have to implement is addition/subtraction, with a few other … | |
Hey im new in this forum but really need help with making program on assembly 8086 that will take a string of 4 characters , then check if they are right and after that convert them to binary and decimal, then again hexadecimal, and in the end print something like … | |
Hello software developers :) I've decided to try and "crack" a (very simple) program I've written myself, just for the sake of it. Here's the code: [CODE] #include <stdio.h> const int serialCode = 255; int guess; int main() { printf("Please enter your serial code: "); scanf("%d", &guess); if(guess == serialCode) … | |
I think its more than a year that I ask my questions about programming in this forum.Looks like its the time that I help a little too. So I wanna put my best here.I hope it'll help some one. Still I'll appreciate any suggestion. Another point,It was my first time … | |
I'm trying to convert hexadecimal values to Binary. I've done Decimal values to Binary up to 32 bits in this way: [CODE] #include <stdio.h> int showbits(int);/**************function*prototype******************************/ int main() { unsigned int num; printf("enter the number."); scanf("%d",&num); printf("%d in binary is ",num); printf("\n"); showbits(num);/*********************function*call********************************/ return 0; } showbits (int n)/******************function*definition****************************/ //* … | |
Hi all, I am trying convert IP addresses form Decimal format [Like 192.168.12.13] to HEX format [c0 a8 9d 80]. For Example the IP "192.168.157.128" is equivalent to "c0 a8 9d 80" in HEX. How to do that.?? | |
Hi, This is probably in the wrong place but I've looked everywhere for help, and nothing yet. I have a game save for an indie game, and I'm trying to edit the amount of coins I have. The method I have tried hasn't worked and I'm unsure why. Here was … | |
This is a conversion question that has me stumped. I need to convert an unsigned char to a signed float. Some examples: 0xFF becomes 1.0f 0x00 becomes -1.0f 0x80 becomes ~0.0f The only idea that I could come up with was a massive switch statement. But a switch statement will … | |
Program is suppose to convert binary to hex.. it says that i need a class/struct/union to the left of ".substr" but im pretty sure convert should be working.. [CODE]#include <iostream> #include <string> using namespace std; int main () { string convert [8]; string bin[16]= {"0000", "0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; string hex[16]= { "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; … | |
I've been scouring the internet and my textbooks and haven't found any good explanations about how to incorporate hexadecimal numbers into my C++ code. I am currently working on a program that acts as a simulated computer environment to run a simulated machine language in the console a maximum of … | |
Trying to convert from binary to hex but for some reason it keeps bringing up the error instead of the output [CODE] #include<iostream> #include<string> #include<cmath> using namespace std; void BintoHex (int[]); bool CheckBin (int[], bool); void Hexadecimal (int[]); string hexadecimal; void main() { int bin[4]; int binary; bool reentry = … | |
ok so for some reason its telling me my "else" has no matching "if" in line 51, i have to make it so the binary output is spaced which im pretty sure i did and has to have a separate output if the character length is more than 8 [CODE]#include<iostream> … | |
Need help converting from hex to binary any help is very appreciated!! [CODE]#include <string> #include <iostream> class Hex { private: //constructor std::string hexNumber; int decNumber; public: Hex(std::string hNum): hexNumber(hNum) {} Hex(int dNum): decNumber(dNum) {} ~Hex(); int toInt(); std::string toBin(); std::string toHex(); }; [/CODE] it keeps saying i need to put … | |
Hey guys I am currently writing a code that will take the user input of a number and convert it to its hexadecimal form with the use of Stack ADT. This is what I have so far and would appreciate any help. [CODE]#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "stack.h" … | |
i have a simple question: I want to define a hex character array in C, but I don't want to have to define the elements one at a time. my programme needs an hexadecimal array as input of 128 bits. for example, [code=c]unsigned char temp2[32]= {0x00 ,0x11 ,0x22 ,0x33 ,0x44 … | |
hi, i have a script that converts hex to bin and bin to hex back. however, when converting back to hex the leading 0s are truncated. how to maintain the leading 0s? i'm using Python 2.5 and Win XP. tq [CODE] import binascii import string def byte_to_binary(n): return ''.join(str((n & … | |
I am to write a program that converts either binary, hex or octal to decimal. We are to use methods for the first time (Not a problem). I have written almost all of the code but the conversion. We can't use int.toDecimal or any shortcut. All must be long coded … | |
I have two codes in C and in Python. They gave me different results. Can anybody explain how they works, why I get different results? Thank you in advance!!! In C: ----------- #include <stdio.h> int main() { int a = 100; printf("%d = %02x\n", a, a); a = ~a; printf("%d … | |
Hello, I would like some help on this one problem in my assignment. I have completed the table but something caught my attention and i feel i did something wrong. I attached the same table i filled out on this thread. I would like help on the first row. My … | |
Hi, i am working on a project that involves converting 8-bit hex numbers into integer. Firt, I have to say that my hex number is not a number right now, it is only a bunch of characters. for example: int d; char code[9]; code="FFFFFF01"; d=strtol(code,NULL,16); when I try to printf … | |
Hi there, it's me again. My last post isn't even solved yet but already i'm on a new job, of which i'm not very proud. This time i need to convert the hex codes i put in a textbox as a string like this: "55 00 01 61 07 46" … | |
The following lines of code output "FFFFFFFF" #include <stdio.h> int main(void) { int i; i=-1; printf("\n%X\n",i); return 0; } This is the 32-bit representation of -1 in Hex. I'm trying to get it to output fewer bits: e.g. 24-bit: FFFFFF In fact, the output I want needs to be 6 … | |
Dear All , I have a binary file , the defincition of its content is as below L Here is one of my 'log items' from the data.bin, all data is stored in little endian (ie. least significant byte first) 11 63 39 46 --- Time, UTC in seconds since … | |
Dear All , I have a device with upon serial communication , it send the data as HEX values , (eg, C020042ABD0F91A103E400F929EBC) . I use the following code to get data from the serial port. [code] Dim fStream As New FileStream(sFileName, FileMode.CreateNew) ' creates new file Dim bw As New … | |
hi i really need help, i m trying to write a program that displays in a textbox a talbe of the binary, octal, and hexadecimal equivalents of the decimal numbers in range 1-222. Plz help i m new to vb....Thks you | |
Hi, I found a number of post talking about this in C, but could not solve it in C++. I have 4 hex characters to represent a length. These need to be stored like this, in the case where length=16 ([URL="http://www.easycalculation.com/decimal-converter.php"]this online converter[/URL] told me that 16 converts to A … |
The End.