hex « hex « C Data Type Q&A

Home
C Data Type Q&A
1.binary
2.bit
3.byte
4.char
5.character
6.decimal
7.Development
8.float
9.hex
10.integer
11.prime
12.random
13.struct
C Data Type Q&A » hex » hex 

1. Mac address ff:ff:ff:ff:ff:ff in C (hex)    stackoverflow.com

How do I write the MAC address ff:ff:ff:ff:ff:ff as a char[] in C? Do I just do char macaddress[6] = "%0xFF%0xFF%0xFF%0xFF%0xFF%0xFF"; I'm not sure. Thanks!

2. C converts HEX value from emacs into the incorrect value    stackoverflow.com

in a file, i have used m-x ucs-insert to insert a hex character 9e (which in emacs shows up as \236). however, when this is read in by the C program, ...

3. What does `return 0x1;` mean?    stackoverflow.com

When browsing the source of a project on web I've found some weird to me return statement in main:

int main()
{
    /* ... */
    return 0x1;
}
So ...

4. Hex code for Control+Question Mark?    stackoverflow.com

I am trying to set the special characters for a serial port in a C program. I am able to find all of the hex codes except the code for ^? ...

5. Interpreting hex values?    stackoverflow.com

This might be very basic or even silly to experts here but I wanted to get my head around this. Most of the times I generally write hex values like this ...

6. Manipulating Hexadecimals in C    stackoverflow.com

I have a C code during which I open a file to input a hexadecimal number. Then I want to add the number obtained it to another single digit hexadecimal and ...

7. help with scanf hex in C    stackoverflow.com

i am trying to scan an input file with such format r1 = 0c100009 So far I have tried this but the while loop is skipped and the output is 0.

   ...

8. UART program to send hex value    stackoverflow.com

I need to send a Hex value 0x5500ff09f6 through UART , can any one please provide me the solution how to send long hex values. Please share your ideas. i m ...

9. HEX to ASM to C    bytes.com

this is not simple as modern compilers optimise code for size and/or efficency so often the code generated by the compiler does not appear to have a one to one relationship with the C source. In the past I have done this conversion by looking at PIC18 and PIC24 ASM programs to get the general structure and in particular the bit ...

11. Hex    bytes.com

12. how to pass hex value to fputc    bytes.com

Summu82 wrote:[color=blue] > Hi i have to write some data in a binary file > > fputc(0x22,f2); > > this works fine > > also > int data =0x22; > > fputc(0x22,f2); > works fine > > but > int data; > data =0x22; > fputc(0x22,f2); > gives error >[/color] You'd better ask the question again with the correct code and ...

13. stringizing a hex value in the preprocessor    bytes.com

Consider the little program below. It simply attempts to determine what version of what compiler it was built with via documented preprocessor macros and print out the result. When the compiler is gcc it works fine, because __VERSION__ is supplied as a string. But identifying the Sun compiler is harder because it provides __SUNPRO_C as a numerical value (equal in my ...

14. HEX swapnibbles    cboard.cprogramming.com

15. help with makeing a forloop for hex please    cboard.cprogramming.com

I'm trying to make a for loop for hex... I had the code below but I would figure it would be less confusing with a for loop but I"m having trouble geeing it to work right Code: hexStr[i] = '0'; hexStr[8]=0;//Terminating null andResult = value & mask;// masked off all but 4 lowest bits hexStr[7] = lut[andResult]; value = value >> ...

16. hex addition through assembly code in c    cboard.cprogramming.com

17. Problem with fread() and Hex    cboard.cprogramming.com

18. why do we need hex ?    cboard.cprogramming.com

Simply put, if you want to describe bits (binary digits), hex is excellent, e.g. 2^10 = 0x400 = 1024 - they all become exactly the same for the computer 0010 0000 0000 is the binary value. If you want to say one thousand, then 0x3E8 is just cryptic. But if you want to know which bits are set in a "random" ...

19. Hex editor problem    cboard.cprogramming.com

#include #include #include #include int main(int argc, char *argv[]) { struct stat fbuf; FILE *dump; int i; int x = 0; unsigned int size; if(argc<2) { puts("Format: HEXDUMP filename"); exit(0); } dump = fopen(argv[1],"rb"); if(dump == NULL) { printf("Error opening %s.",argv[1]); exit(0); } size = stat(argv[1],&fbuf); size = fbuf.st_size; while(i=fgetc(dump), size != 0) { printf("%0.2X ",i); x++; ...

20. hex math    cboard.cprogramming.com

21. Hex    cboard.cprogramming.com

22. need help with hex adder.    cboard.cprogramming.com

Hi, just having trouble with my hex adder. It will have to do several things first of which is to add two hex numbers together. It is read in with scanf as you will see below then I am going to use several if statements to achive the different functions of my adder. However i have run into a problem or ...

23. Hex Editing help and information please...    cboard.cprogramming.com

Ive written a short and simple DOS General C program (Dev-C++) to lsit the files in my working directory, then read and print out the hex of any file name entered (it takes the file entered, reads the actual file). Now, the line number is listed in hex perfectly fine, but the hex of the string on that line is the ...

24. quick hex question    cboard.cprogramming.com

i have a bunch of data coming into my system that is in hex format. to test my program, i put in an exact example of an input into the array it will be assigned to but came up with a bunch of errors, Code: unsigned char Hex_array[BUFFSIZ] =unsigned char Hex_array[BUFFSIZ]= "#RAWWAASFRAMEA,COM1,9,68.0,SATTIME,1263,248186.000,000000000,58e4,1522,22,122,62,563456345dba43623443efdaef3245345fea325345626634623623c000,22*d04567cde"; errors: Code: rubbish.cpp C:\Documents and Settings\shss.GRUPOGMV\My Documents\C Stuff\decoding\rubbish.cpp(18) : ...

25. Hex Questions    cboard.cprogramming.com

26. a large hex counter    cboard.cprogramming.com

I need to make a counter using hex I want an array of length 10 to be updated each cycle with the next hex number. So the array would start with: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ... 0 0 0 0 0 0 0 0 0 ...

27. Hex?    cboard.cprogramming.com

28. Hex distance    cboard.cprogramming.com

29. hex grid    cboard.cprogramming.com

Hi there, I have a hex grid that grows in a spiral and am trying to figure out how to assign (x,y) values to a hexagon. / \__/ \__/ \__/ \__/ \__/ \ \__/ \__/ \__/41\__/ \__/ \__/ / \__/.. \__/40\__/42\__/ \__/ \ \__/62\__/39\__/22\__/43\__/ \__/ / \__/38\__/21\__/23\__/44\__/ \ \__/61\__/20\__/ 9 \__/24\__/45\__/ / \__/37\__/ 8 \__/10\__/25\__/ \ \__/60\__/19\__/ 2 \__/11\__/46\__/ / \__/36\__/ ...

30. Hex Values - C    cboard.cprogramming.com

Like QuestionC says, it's just matter of protocol. In other words, it's a matter of how you define which bit is on which place. As I understand you have a 64 bit value. Let's define that the value is defined as follows (in bits): b63 b62 ...... b1 b0 This can be grouped in bytes as follows: B7 B6 ... B1 ...

31. Hex    cboard.cprogramming.com

32. Adding hex values from a line    forums.devshed.com

hi guys... im trying to read a .txt file from c drive, that file contains all hex values....line this 20 F8 C1 1E 06 EC 95 F4 F8 7E 68 00 F8 61 68 00 20 00 69 77 0B 00 20 FF 69 77 16 00 74 F0 F3 1F 74 F0 F9 1F 00 77 00 00 26 77 ...

33. How to parse hex values    forums.devshed.com

The key to parsing is knowing how to extract the data based on the data around it. You have not provided any sort of indication to let us know how you came to determine that the data you have highlighted is that which you need to extract. Therefore, it's next to impossible to help you without more information.

34. Hex iterator    forums.devshed.com

35. streaming in hex values    forums.devshed.com

I've run in to a bit of a problem streaming data from a file. I'm using I/O manipulators (or setting them the long way, it makes no diffrence). If the hex value to be read starts with a digit, no problem. If it starts with a-f it ends up with unpredictable results. long timestamp; long address1, address2; inData >> dec >> ...

36. Problem with Hex    forums.devshed.com

hi, I am having a small problem with hexadcimals...... Code: unsigned char query[8]; unsigned char offset_hi; unsigned char offset_lo; unsigned char crc_hi; unsigned char crc_lo; unsigned char numreg_hi; unsigned char numreg_lo; . . . query[0] = slave; //slave is int query[1] = function; //function is int and value is 3 query[2] = offset_hi; /* base address of register table Hi byte ...

37. Maximizing Storage Space using Hex    forums.devshed.com

Hi all. Bit of a newbie question... Can someone give me the Readers Digest version of how to store floats/ints as hex... Is it simply stroring a number (say 65325) by pairing up numbers as a hex value? i.e. 0x06 0x53 0x25. This is all I've been able to find on the subject so far but, I'm curious as to how ...

38. Parse Hex into Assembler instructions    daniweb.com

#include #include #include #define SIZE 120 int main () { FILE* fp; char str[SIZE][SIZE] = {{'\0'}}; char* filename = "words.txt"; char test[SIZE]; char *ptr; int i, len; int r=0; printf("\n\n"); if (!(fp = fopen(filename,"r"))) { printf("\nCannot open %s for output.\n",filename); return 1; } ptr = NULL; len = r = 0; while(fgets(test,SIZE,fp) != NULL) { ptr=strtok(test, " "); ...

39. Trouble with hex    daniweb.com

I am writing some code to talk to a device via a serial port. I am testing my program by using a loopback, so I can see that what I send is correct. I am sending an unsigned hex array, and when I display the values (before they are sent), they are fine. However, when the array comes back, values over ...

40. Write to hex, is it possible?    daniweb.com

41. C to Hex    daniweb.com

42. Hex Editor (OCX Control) License    codeproject.com

43. Next hex value excluding 'A'    tek-tips.com

Hi all,having a string containing 4 hex digits, I need a function that returns the next hex value excluding 'A's. For example:string = "1999" ==> next value = "199B". This is what i have so far: CODE #include #include #include /* returns the next hex value excluding 'A's */char *next_code (char *code)/* code is guaranteed to point to a string containing ...

44. sending hex to serial port    tek-tips.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.