Recommended Answers
Jump to PostYou can pass character by character to itoa with radix 16.
If you only want to display the hex values, you can use printf with format specifiers %x or %X.
Jump to PostIf you use the radix 10, you will get a string of the an integer in base 10.
For radix 16, you will get a hexadecimal string.
You can try the example in the given web page or the one below.
e.g#include <stdio.h> #include <string.h> #include …
Jump to PostLooks like a linker error. Do you have this problem for my example only or for the example given in the link I posted also?
Jump to PostI cant see no given web page,
I mean this web page.
Jump to PostWhen i try to compile, i get this
> gcc string_to_hex.c
Undefined first referenced
symbol in file
itoa /tmp/cc21JKaJ.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit statusYes of course itoa is nonstandard. U can implement your own itoa
http://www.daniweb.com/techtalkforums/showthread.php?t=11049&highlight=itoa
or use …
All 22 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.