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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:33:36+00:00 2026-05-11T12:33:36+00:00

Is it appropriate to access a class’ private members by casting it to a

  • 0

Is it appropriate to access a class’ private members by casting it to a void pointer and then to a struct?

I don’t think I have permissions to modify the class that contains the data members that I need to access. I don’t want to take a risk accessing the data members in an indirect way if it is not ethical.

EDIT: Had to edit this further… I am pretty sure the class wouldn’t be modified, so it’s ok to that extent… my only concern is, if the person who coded that class gets to know of this, it might not go down well with him :(.

  • 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. 2026-05-11T12:33:37+00:00Added an answer on May 11, 2026 at 12:33 pm

    ‘Never say never’. I’m sure somewhere in the universe, there’s a situation that will force you to have to do this…

    But I certainly would cringe if I had to do it. You truly need get lots of opinions on your situation before pulling the trigger. Can you describe your specific situation and maybe we could see if it makes sense or what better alternatives might exist?

    In response to comment/question– Define ‘permissions’ — institutional permission? That sounds like not a programming problem, but something to talk to whoever is asserting said permission. Maybe this is more of a political issue than a technical one? Again, I think we need more specifics–even if it was somewhat about the politics of the situation. That may or may not be deemed out of scope for the website, however.

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

Sidebar

Ask A Question

Stats

  • Questions 297k
  • Answers 297k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Internally MultiDimSetAt uses SafeArrayPutElement function. It means that BSTRs would… May 13, 2026 at 7:19 pm
  • Editorial Team
    Editorial Team added an answer Essential reading for implementors of SMTP servers: RFC 821 (and… May 13, 2026 at 7:19 pm
  • Editorial Team
    Editorial Team added an answer Don't know if it is an elegant solution, you can… May 13, 2026 at 7:19 pm

Related Questions

Is it appropriate to access a class' private members by casting it to a
I hope that in this post, I can get people's opinions on best practices
I would like to create a singleton class that is instantiated once in each
Please keep in mind that I'm new to C# and OOP so I apologize
I have the code of a simple game, where an AgentInterface must be implemented

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.