Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4337080
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:53:42+00:00 2026-05-21T10:53:42+00:00

I have a number of xmlChar * in my source file and I need

  • 0

I have a number of xmlChar * in my source file and I need them to be in integer form.

How does one cast these correctly?

When I tried this world->representation = malloc(sizeof(int *) * mapHeight); it says

error: invalid operands to binary * (have ‘long unsigned int’ and ‘xmlChar *’)

and when I tried this

world->representation = malloc(sizeof(int *) * (int) mapHeight);

I got this error

Undefined symbols for architecture x86_64:
“_main”, referenced from:
start in crt1.10.6.o
“_commandfetcher”, referenced from:
_commandFetcher in ccPv5Pvd.o
ld: symbol(s) not found for architecture x86_64

How can I cast a xmlChar pointer to an int? e.g the xmlChar has the value of 30, I need this in int form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:53:43+00:00Added an answer on May 21, 2026 at 10:53 am

    You can’t simply cast a char to an int. (Or rather, you can, but it doesn’t do what you think it does.)

    Use strtol to convert a string to an integer:

    char* number = "30";
    int value = strtol(number, NULL, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of classes (more than 40), each one has a number
I have number array: 16,17,19,19,20. I need to find a missing number/gap (in this
I have number and need to add the suffix: 'st', 'nd', 'rd', 'th'. So
i have a pdf file which have number of 300 pages, and each set
I am making one Html application. I have number of images in my folder.I
I have number of conditions i'd like to check before submitting a form so
Say I have the following code: private Integer number; private final Object numberLock =
I have number of line breaks in a string. But I only want it
I'm stuck with the following scenario and appreciate any help/advice.. Requirement I have number
I have a number input that should trigger jQuery on every change. To do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.