Write code for atoi(x) where x is hexadecimal string.

Answer Posted / audrius

long l = strtol(string, NULL, 16);
//or, if you need unsigned (which you usually do with hexes)
unsigned long ul = strtoul(string, NULL, 16);

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

643


Write a program to print fibonacci series using recursion?

581


What is the full form of getch?

580


What is the acronym for ansi?

626


Is c++ based on c?

646






What is the scope of static variable in c?

531


what are enumerations in C

720


What is a program flowchart?

598


What is data structure in c and its types?

591


In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

1954


Here is a good puzzle: how do you write a program which produces its own source code as output?

591


How do we print only part of a string in c?

579


What is scope rule in c?

603


How to declare pointer variables?

683


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

635