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 8913143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:23:11+00:00 2026-06-15T04:23:11+00:00

I have a method **int** create_object(Object* parent, char* name, int type, int start_block) {

  • 0

I have a method

**int** create_object(Object* parent, char* name, int type, int start_block) {
  ...
  return ptr_to_object;
}

Inside the function ptr_to_object seems to be a 32-bits but then as soon as it gets out of it, it looks like its 64-bits.

Note: I cannot use c99, I know that intptr_t is part of c99.

What are your suggestions? Thanks!

  • 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-06-15T04:23:13+00:00Added an answer on June 15, 2026 at 4:23 am

    If you’re dealing with pointers, either use a pointer return type, or “hide” it in an int-type defined by the standard to be large enough to support holding a pointer. Such a type can exist but is not guaranteed to exist (tmk):

    C99 7.20.1.4 Integer types capable of holding object pointers

    1. The following type designates a signed integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer:

      intptr_t

      The following type designates an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer:

      uintptr_t

      These types are optional.

    The keyword there is optional. Chance are likely it is defined on your platform of choice, but for legacy portability you’re probably better off either returning a void * or declaring a specialized “handle” to a typed or void pointer and returning that.

    As always, I’m entirely interested in anyone that is working with a C99-compliant platform that chose not to expose some of the features presented as optional in the standard (like this one). If there is anyone out that with a <stdint.h> without intptr_t and/or uintptr_t I’m very curious. Please leave a comment if you work with such a toolchain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a method: bool myMethod(int a) { //return a bool }
i have a method like this: public JObject Get(int id) { return new JObject(new
I have a method connection(int n) which gives me all the cells number that
Suppose I have the following method signature int f (int[] values) and I call
I have this method: public CampaignCreative GetCampaignCreativeById(int id) { using (var db = GetContext())
If I have a method like this: public void DoSomething(int Count, string[] Lines) {
I have a method ... where I can't find the error: public String getUsernameforID(int
I have a method in a class as follows... class foo{ int bar::randomNum10to50(){ srand
I have a method for getting values from database. public virtual List<TEntity> GetValues( int?
I have a method with this signature: IEnumerable<string> GetCombinations(string s, int length) And I

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.