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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:38:44+00:00 2026-05-30T07:38:44+00:00

Alright here’s the code: //in another file void **ptr; ptr = kmalloc(sizeof(void *) *

  • 0

Alright here’s the code:

//in another file

void **ptr; ptr = kmalloc(sizeof(void *) * 2);

  *(ptr+0) = tf; //type trapframe *
  *(ptr+1) = as; //type addrspace *

func(*ptr); 

And here is that function:

void func(void *ptr) {

struct trapframe *parentTF = ptr[0];
struct addrspace *newAS = ptr[1]; 
//now I wanna do stuff with parentTF and newAS

}

And the error I get is:

warning: dereferencing `void *' pointer

Thanks for any help.

  • 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-30T07:38:45+00:00Added an answer on May 30, 2026 at 7:38 am

    If I’m correctly understanding what you’re trying to do, it seems like you need to change this:

    void func(void *ptr) {
    

    to this:

    void func(void **ptr) {
    

    and this:

    func(*ptr);
    

    to this:

    func(ptr);
    

    Note that *(ptr+0) and ptr[0] are synonymous, as are *(ptr+1) and ptr[1].

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

Sidebar

Related Questions

Alright, so here's the portion of my code that is giving me a problem.
Alright so here is my issue. I'm working a game engine that will eventually
Alright so here is the deal. I am trying to make a application that's
Alright, currently I have my SWF hitting a php file that will go and
Alright, here's my dillema. I am making a simple application with Qt Creator that
Alright, so here's my problem. I'm trying to write a script in PHP that
alright, im looking at a code here and the idea is difficult to understand.
Alright here's the situation, I have an application written in the Zend_Framework, that is
Alright, here we go. I have a cocos2d app, and there are targets that
Alright, so here's the dealio: I'm working on a Ruby app that'll take data

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.