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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:14:34+00:00 2026-05-15T01:14:34+00:00

Possible Duplicates: C++: ptr->hello(); /* VERSUS */ (*ptr).hello(); Why does C have a distinction

  • 0

Possible Duplicates:
C++: ptr->hello(); /* VERSUS */ (*ptr).hello();
Why does C have a distinction between -> and . ?

I know the difference between the member operator (.) and the member by pointer operator (->).

Why did the C designers create a different operator for this access? Why can’t the compiler figure it out on its own?

If you always used a . does any case exist where it is ambiguous whether you mean a member or a member by pointer?

edit: I’m not looking for the “(*a).b” syntax. I asking why didn’t the designers allow you to use “a.b” instead of “a->b”?

  • 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-15T01:14:35+00:00Added an answer on May 15, 2026 at 1:14 am

    When you have a language that is, at its core, intended to be a “portable assembler” you don’t try to hide implementation details from the user. Of course the compiler can figure out that in the expression a.b the a in question is a pointer. Can you? Reliably? All the time? In hairy, complicated code? And can you not envision a circumstance where not being able to quickly note that a is a pointer could be a problem?

    Stop thinking in terms of “hard to write” and start thinking in terms of “easy to read”. (Yeah, I know. This goes against the whole C programmer mythos!) You’ll be reading code a couple of orders of magnitude more often than you’ll be writing it.

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

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • 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 For minimal duplication, you can use one project, with 2… May 16, 2026 at 5:29 pm
  • Editorial Team
    Editorial Team added an answer I've been out the office today. In the mean time… May 16, 2026 at 5:29 pm
  • Editorial Team
    Editorial Team added an answer You can do this from a module: function mymodule_init() {… May 16, 2026 at 5:29 pm

Trending Tags

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

Top Members

Related Questions

Possible Duplicate: Should a function have only one return statement? Hello, gcc 4.4.4 c89
Possible Duplicates: Do I cast the result of malloc? Should I explicitly cast malloc()'s
Possible Duplicates: Do-While and if-else statements in C/C++ macros do { … } while
Possible Duplicates: How to check for equals? (0 == i) or (i == 0)
Possible Duplicate: casting char[][] to char** causes segfault? I have a 2D array declared
Possible Duplicates: C++0X when? When will C++0x be finished? When will C++0x be released?
Possible Duplicates: Why is lock(this) {...} bad? In C# it is common to use
Possible Duplicates: [.NET] How do I disable a system device? Win32 API function to
Possible Duplicates: Why use ++i instead of i++ in cases where the value is
Possible Duplicates: How do I convert an InputStream to a String in Java? In

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.