Re: Hex Addition Help Programming Software Development by Intrade …^1 * 10 + 16 ^ 0 * 13 which is 160 + 13 = 173, Hex number: 53 which is 16^1 * 5 + 16^0 * 3… 83 is 256, so your hex result should be the same-- Hex result: AD + 53 = 100 (in Hex) 1-carried from (1 + A… higher than 1 unless you're summing more than 2 hex-values. Re: Hex search problem Programming Software Development by ChrisPadgham hex is only a way of representing a number for human consumption, they are held in binary after all. What is the data type that is holding the number, is it a text string or an integer. That will determine what your findfirst looks like. Text fields have quotes around them, integers do not. Re: Hex to char? Programming Databases by Alberto Bucur HEX(), UNHEX() functions. http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_hex http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_unhex Re: hex Programming Software Development by Lerner … want to do is to see the hex equivalent of a value, not manipulate the hex equivalent of a value, then there… is a stream flag/modifier by the name of hex that can be used to view the value of a… hex Programming Software Development by ghadahelal is there is any fun in the c++ library that takes a dec and return hex Re: hex Programming Software Development by Narue >that's c not c++ sprintf is C++ too. >do u know anyother sol. in c++ Yes, use the hex manipulator with either cout or a string stream. Alternatively, you can do the conversion manually, but since that's available in C as well, I guess it doesn't count as C++. :icon_rolleyes: Hex to Binary Programming Software Development by manofhouse …'||hex[h]=='3' ||hex[h]=='4'||hex[h]=='5'||hex[h]=='6' ||hex[h]=='7'||hex[h]=='8'||hex[h]=='9' ||hex[h]=='a'||hex[h]=='b'||hex[h]=='c' ||hex…[h]=='d'||hex Re: Hex to Binary Programming Software Development by manofhouse …'||hex[h]=='3' ||hex[h]=='4'||hex[h]=='5'||hex[h]=='6' ||hex[h]=='7'||hex[h]=='8'||hex[h]=='9' ||hex[h]=='a'||hex[h]=='b'||hex[h]=='c' ||hex…[h]=='d'||hex Re: Hex to Binary Programming Software Development by VernonDozier …, aside from all that, before asking for input, initialize the hex[] array to something legal and see if you still get… Hex to Bin help! Programming Software Development by manofhouse …;string> #include <sstream> #include "hex.h" Hex::~Hex() //destructor { } int Hex::toInt() { int num; std::stringstream toBeConverted(hexNumber); toBeConverted… Re: Hex minus 1 Programming Software Development by joekbit …tried HextoDec function, but not having success) Example Hex = FF FF Hex - 1 = FF FE[/QUOTE] This site may…reverse the process to display the new hex. Yes the hex value would be FF FE If … strMyHexNum lngDecimalValue = Val(strMyHexNum) PRINT strMyHexNum; " in hex is equivalent to "; lngDecimalValue; " in decimal."… Hex display! Programming Software Development by chubbyy.putto …* hex_offset; /* Position of the next character * in Hex */ char * ascii_offset; /* Position of the next character…* ASCII character. */ return(++position); } char * hex(char *position, int c) { int offset=3… Re: hex string to true binary w. bit manipulation Programming Software Development by mrynit …= 1; i < 24; i++) { // bitmask 10000000000000000000000 if ((hex & 4194304) == 4194304) { System.out.print("+ 2^-" …+ i + " "); } hex = hex << 1; } } System.out.println(")"); } } [/CODE] Hex to String Programming Software Development by ashkash …out to a file. I have a string in hex values and I need to write this out to the… output file. The hex string I have is 4b70 4772 64. The string … as a string and not hex values. I need it to be written as hex values where byte 1 woiuld be…, when I open up the output file in a Hex editor I should see the first 6 bytes as 4b… Hex Addition - Assertion Failure Programming Software Development by rfrapp … appreciated. Thank you for you time! [CODE] // hex addition.cpp : Defines the entry point for the console …argc, _TCHAR* argv[]) { //assign values to last six hex characters //convert both inputs to dec //add two dec …numbers //convert back go hex for answer string input; string input2; string hex[16] = {"0", … Re: Hex minus 1 Programming Software Development by sidnei … code to check: [CODE] Dim nValor As Long 'To take hex representation in VB, follow number by an &H sign… same - only the representation of it is changing... [CODE] MsgBox Hex(nValor) [/CODE] By the way, you can represent it in…;1099596]In VB6, how would I subtract 1 from a Hex? Do I need to convert to Integer first? (have tried… hex value instead of string Programming Software Development by BastienP …even with that I encounter hex values instead of string. I think that these hex values are generated every time…"X'332c206176656e7565204e6577746f6e0d0a'", which is a string encoded in hex, and means "3, avenue Newton " once …quot; and then convert the rest of the value from hex to string, but I have some trouble... Any idea… Re: hex value instead of string Programming Software Development by BastienP … I've finaly found some time to test/implement the hex decryption algorythm. I've written this: [CODE] #! … sub convert{ #This subroutine contains Mike's regex to substitute hex digits with #the corresponding characters my $mem = $_;… #Remove 0d0a from string of hex digits $mem =~ s/0d0a//; $mem=~s/([a-fA-F0… Re: Hex to Decimal Conversion in C Programming Software Development by prushik why not just use: [CODE] printf("Input hexadecimal number: "); int hex; scanf("%x",hex);[/CODE] Seems easiest to me, then it gets stored as an int. you can display it as a hex or a decimal: [ICODE]printf("%X",hex)[/ICODE] Hex [ICODE]printf("%d",hex)[/ICODE] Decimal Re: hex value instead of string Programming Software Development by d5e5 …; sub convert{ #This subroutine contains Mike's regex to substitute hex digits with #the corresponding characters my $mem = $_[0]; $mem… =~ s/0d0a//; #Remove 0d0a from string of hex digits $mem=~s/([a-fA-F0-9]{2})/chr… Re: hex value instead of string Programming Software Development by BastienP … convert{ #This subroutine contains Mike's regex to substitute hex digits with #the corresponding characters my $mem = $_…; #Remove 0d0a from string of hex digits $mem =~ s/0d0a//; $mem =~ s/X\'//; …$mem=~s/([a-fA-F0-9]{2})/chr(hex $1)/eg; chomp $mem; return $mem; }[/CODE]… Re: hex value instead of string Programming Software Development by d5e5 …); sub convert{ #This subroutine contains Mike's regex to substitute hex digits with #the corresponding characters my $mem = $_[0]; #The… args, @_ $mem =~ s/0d0a//; #Remove 0d0a from string of hex digits $mem=~s/([a-fA-F0-9]{2})/chr… Re: hex value instead of string Programming Software Development by BastienP …sub convert{ #This subroutine contains Mike's regex to substitute hex digits with #the corresponding characters my $mem = $_[…_ $mem =~ s/0d0a//; #Remove 0d0a from string of hex digits $mem =~ s/c3a2/e2/; #change a circumflex …correctly encoded $mem=~s/([a-fA-F0-9]{2})/chr(hex $1)/eg; chomp $mem; return $mem; }[/CODE… Re: Hex display! Programming Software Development by Schol-R-LEA It is quite simple: first, you need an `unsigned int` variable as a counter, which should be initialized to zero. Alter your `printf()` statement to print this counter as a four-digit hex value followed by a a semi-colon and a space, followed by the string you are now printing. Finally, at the end of the printing loop, add NUM_CHARS to the counter. Re: Hex conversion problem Programming Software Development by JeoSaurus …echo "Usage: $0 <hex#>" exit fi TEST="$1" HEX=$(echo -n ${TEST:2:4}${TEST…2}) #DEC=$(echo "ibase=16; obase=10; $HEX" |bc) DEC=$(( 16#${HEX} )) RESULT=$(( ${DEC}/8 )) echo "Input was…: $TEST" echo "Rearranged to: $HEX" echo "Converted to dec: $DEC" echo &… Re: Hex to String Programming Software Development by Narue You need to do some converting. Do some research on the std::hex stream manipulator for ideas. Re: Hex to String Programming Software Development by ArkM Hmm, hex manipulator on the C language forum... Be afraid of pure C fanatics ;)... Re: Hex Addition Help Programming Software Development by VernonDozier …I am most confused about the actual conversion from Hex to decimal at the moment.[/QUOTE] 1. Declare … it to 0. 2. Go through the hex string one character at a time. 2a. Isolate …the hex digit and and convert it to an integer …. 2b. Figure out the "place" of that hex integer (i.e. 1, 16, 256, 4096, etc.).… Hex encryption help Programming Software Development by hondros … file's binary code, and convert it to hex? 2) After opening it in hex, it shoud become manipulatable, such as, I… change each odd charecter, correct? 3) After messing with the hex, how do I convert it back into binary, then save… Hex minus 1 Programming Software Development by planethax In VB6, how would I subtract 1 from a Hex? Do I need to convert to Integer first? (have tried HextoDec function, but not having success) Example Hex = FF FF Hex - 1 = FF FE