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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:18:08+00:00 2026-05-27T02:18:08+00:00

(I want to deal with void I am avoid template class because it is

  • 0

(I want to deal with “void” I am avoid “template class” because it is too much trouble)

ok establish some ground

int aa=3;
int bb=4;
int cc=0;

int *a, *b, *c;

a = &aa;
b = &bb;
c = &cc;

*c = *a +*b; //yields 7

but I want to do the following:

void *va;
void *vb;
void *vc;

va = a;
vb = b;

*c = (int)(*va + *vb);  // <-- 3 errors see below

but I get errors:

 error C2100: illegal indirection
 error C2100: illegal indirection
 error C2110: cannot add two pointers
  • 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-27T02:18:09+00:00Added an answer on May 27, 2026 at 2:18 am

    You can’t dereference void pointer.

    If you want to turn them into int* you should do that before dereferencing;

    (*(int*)vc) = (*(int*)va) + (*(int*)vb);
    

    But you better be more specific, what exactly you want to do that you call “the following”.

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

Sidebar

Related Questions

So here is the deal. I want to call a class and pass a
I want to do: template <class Derived=BattleData> class BattleData : public BattleCommandManager<Derived> { };
For those who deal with microcontroller programming... I want to take a momentary contact
I want to create tabpage as userControl. Is there any way to deal with
I spent some time googling but didn't really find anything. I want to be
So I'm trying to create my own BST for a spellchecker because I want
My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want
OK so I'm looking a some code which looks roughly like this: void DoSomething(object
I would like some advice on safe ways to deal with struct's when the
I have a maven library project with some classes to deal xml messages. Whenever

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.