Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

text to hex in C

#include <stdio.h>

#define SIZE 32

int main()
{
    char string[SIZE];
    int i = 0;

    printf("Text to translate: ");
    fgets(string,SIZE,stdin);
    while(string[i] != '
')
    {
        printf("%2x ",string[i]);
        i++;
    }
    putchar(string[i]);

    return(0);
}
Source by c-for-dummies.com #
 
PREVIOUS NEXT
Tagged: #text #hex #C
ADD COMMENT
Topic
Name
3+8 =