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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:36:34+00:00 2026-05-30T23:36:34+00:00

I receive a pointer numeric value like: 0xbfe0e6ac it is possible set int foo

  • 0

I receive a pointer numeric value like: 0xbfe0e6ac it is possible set int foo for example to value of 0xbfe0e6ac that is another int in memory?

My scenario:

I am tried to implement functions for get next index from array passing the pointer value (like the above example) as parameter.

For example:

char * a = "baa";
char* b = "foo";

    printf("%c", cgetnext(&a)); // b
    printf("%c", cgetnext(&a)); // a
    printf("%c", cgetnext(&b)); // f
    printf("%c", cgetnext(&b)); // a

The single way that I can see to do this is: in cgetnex() save pointer of array passed like parameter into array and each call, check if the array passed as paramater was used before and get information of it, like lasindexused and pointer value into RAM.

Here is my code:

#include <string.h>
#include <stdlib.h>

typedef struct  { int pLocation; int lastIndex; } POINTERINFORMATION;

int     __myIndex;
POINTERINFORMATION   pointersLocations[256];
int     pointersLocationsLength;
char *  temparr = NULL;


__myIndex = pointersLocationsLength = 0;

int 
    plAdd (int p)
    {
        if (plLen >= sizeof(pointersLocation)) {
            return -1;
        } else {
            pointersLocation[pointersLocationsLength].pLocation = p;
            pointersLocation[pointersLocationsLength].lastindex = 0;
            pointersLocationsLength ++;
            return pointersLocationsLength;
        }
    }

int 
    getPointer (int p, POINTERINFORMATION ** out)
    {
        int i;
        for (i = 0; i < pointersLocationsLength; i++)
        {
            if(pointersLocation[pointersLocationsLength].pLocation == p)
            {
                *out = makevariablefromponiter(pi.pLocation);
                return 1;
            }
        }

        return 0;
    }

char 
    cgetnext(char * arr) 
    {
        char * myarr; 
        const size_t size = sizeof(char *) + 1;

        myarr = malloc(size);

        if (NULL == arr){
            POINTERINFORMATION * pi;
            if (getPointer(p, &pi))
            {
                __myIndex = pi.lastindex;
                            myarr = makevariablefromponiter(pi.pLocation);
            }
        } else {
            myarr = strdup (arr);
        }

        if (strlen(myarr) == __myIndex) {
            return '\0';
        } else  {
            __myIndex ++;
            temparr = malloc(size);
            temparr = strdup(myarr);
            return myarr[__myIndex - 1];
        }
    }
  • 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-30T23:36:35+00:00Added an answer on May 30, 2026 at 11:36 pm

    Yes, do something like this:

    int *fooPtr = 0xbfe0e6ac;
    
    foo = *fooPtr;
    

    In fact, you can make it even more concise:

    foo = *(int *) 0xbfe0e6ac;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a function that takes a function pointer: int funct(double (*f)(double)); And
I have some Visual C++ code that receives a pointer to a buffer with
I receive a dictionary as input, and would like to to return a dictionary
I'd like to use the following function to return a transposed pointer to a
I create this function in a class and I receive error: pointer to incomplete
If I receive a interface pointer present in the other apartment than the current,
In C or C++ it is possible to use a function pointer as a
In C programming, you can pass any kind of pointer you like as an
I have a small byte array (under 25K) that I receive and decode as
Mike Lischke's TThemeServices subclasses Application.Handle , so that it can receive broadcast notifications from

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.