Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about strtol

Read more about strtol

python (65.2k questions)

javascript (44.3k questions)

reactjs (22.7k questions)

java (20.8k questions)

c# (17.4k questions)

html (16.3k questions)

r (13.7k questions)

android (13k questions)

Questions - strtol

How do u make strtol convert 0

void isInt(char *string) { if (strlen(string) > 2) printf("Invalid") if (!strtol(string, &endptr, 10)) printf("Invalid") printf("Valid&quo...
test-img

Vikil Chandrapati

c

strtol

Votes: 0

Answers: 2

Latest Answer

Would you please try: #include <stdio.h> #include <stdlib.h> #include <string.h> void isInt(char *string) { char *endptr; long val; if (strlen(string) > 2) { ...
test-img

tshiono

How can I convert hex encoded string to string in C efficiently

I need to convert hex encoded string like this: char hstr[9] = "61626364"; // characters abcd\0 Into "abcd" // characters as hex: 0x61 0x62 0x63 0x64 // hex "digits&qu...
test-img

Kamil

c

string

strtol

strtoul

Votes: 0

Answers: 5

Latest Answer

Instead of copying two characters and using strtol you could create a function that converts the characters 0 .. 9 and A .. F to an int (0x0 to 0xF). #include <ctype.h> int toval(char ch) { ...
test-img

Ted Lyngmo

Proper end pointer with strtol() and &quot;0x&quot;?

strtol("0x", &endptr, 16); This completes with endptr pointing to "0x". I expected "x". Is my C library's strtol() amiss, my expectations or something else? The &quo...
test-img

chux - Reinstate Monica

c

language-lawyer

strtol

Votes: 0

Answers: 0

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved