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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:22:31+00:00 2026-05-15T19:22:31+00:00

I vaguely recall seeing this before in an answer to another question, but searching

  • 0

I vaguely recall seeing this before in an answer to another question, but searching has failed to yield the answer.

I can’t recall what is the proper way to declare variables that are pointers. Is it:

Type* instance;

Or:

Type *instance;

Although I know both will compile in most cases, I believe there are some examples where it is significant, possibly related to declaring multiple variables of the same type on the same line, and so one makes more sense than the other.

  • 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-15T19:22:31+00:00Added an answer on May 15, 2026 at 7:22 pm

    It is simply a matter of how you like to read it.

    The reason that some people put it like this:

    Type *instance;
    

    Is because it says that only instance is a pointer. Because if you have a list of variables:

    int* a, b, c;
    

    Only a is a pointer, so it’s easier like so

    int *a, b, c, *d;
    

    Where both a and d are pointers. It actually makes no difference, it’s just about readability.

    Other people like having the * next to the type, because (among other reasons) they consider it a “pointer to an integer” and think the * belongs with the type, not the variable.

    Personally, I always do

    Type *instance;
    

    But it really is up to you, and your company/school code style guidelines.

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

Sidebar

Related Questions

For some reason, this is happening very vaguely. Its working sometimes and sometimes it
I remember touching on this subject during a class on programming languages. I vaguely
Being vaguely familiar with the Java world I was googling for a static analysis
I vaguely remember reading about a programming exercise where objects are drawn on the
Is there a SQL query I can run (or some other way) that will
I vaguely remember reading something somewhere about using Trace.WriteLine over Console.Out.WriteLine in nUnit possibly
libjingle's developer guide quite vaguely mentions incompatibilities between libjingle's implementation of Jingle and XEP-0166's
How do I fix this code so that 1.1 + 2.2 == 3.3? What
I'm considering functions of one argument of type T that return an argument of
Which one of these two ways is faster and why? window.setTimeout(func(), 100); Or window.setTimeout(function(){func();},

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.