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

  • Home
  • SEARCH
  • 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 6709137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:50:41+00:00 2026-05-26T07:50:41+00:00

I am fairly new at C and I don’t know the difference between the

  • 0

I am fairly new at C and I don’t know the difference between the following two variable declarations:

int* ptr;
int *ptr;

I think that in the declaration int* ptr;, ptr‘s value cannot be changed whereas it can be changed for the declaration, int *ptr;

I am not sure if that is it though.

What is the concept behind the two declarations?

  • 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-26T07:50:42+00:00Added an answer on May 26, 2026 at 7:50 am

    To the compiler, there is no difference between the two declarations.

    To the human reader, the former may imply that the “int*” type applies to all declarations in the same statement. However, the * binds only to the following identifier.

    For example, both of the following statements declare only one pointer.

    int* ptr, foo, bar;
    int *ptr, foo, bar;
    

    This statement declares multiple pointers, which prevents using the “int*” spacing.

    int *ptr1, *ptr2, *ptr3;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to C and I don't understand why the following two
I'm fairly new to JQuery and Javascript in general. I don't think I'm trying
I'm fairly new to MySQL and don't know how to write a query I
I'm fairly new to C++ and don't quite understand function parameters with pointers and
I fairly new to JQuery and perhaps trying to achieve something that might be
I'm fairly new to Qt. This is my second 'real' program that I'm writing.
I am fairly new to MVC so please don't hesitate to suggest a better/cleaner/simpler
Still fairly new to django and python... I've defined two forms as follows: class
I'm fairly new to Dreamweaver, I've been working on a website that contains a
Im still fairly new to Django, so please explain things with that in mind.

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.