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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:38:43+00:00 2026-06-08T22:38:43+00:00

I have learned that a pointer points to a memory address so i can

  • 0

I have learned that a pointer points to a memory address so i can use it to alter the value set at that address. So like this:

int *pPointer = &iTuna;

pPointer here has the memory address of iTuna. So we can use pPointer to alter the value at iTuna. If I print pPointer the memory address gets printed and if I print *pPointer then the value at iTuna gets printed

Now see this program

    char* pStr= "Hello !";
cout<< pStr << endl;
cout<< *pStr << endl;
system("PAUSE");
return 0;

There are a lot of stuff I don’t understand here:

  1. In “Hello !” Each letter is stored separately, and a pointer holds one memory address. So how does pStr point to all the letters.

  2. Also When I print out pStr it prints Hello !, not a memory address.

  3. And when I print out *pStr it prints out H only not all what pStr is pointing too.

I really can’t understand and these are my concerns. I hope someone can explain to me how this works ad help me understand

  • 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-06-08T22:38:45+00:00Added an answer on June 8, 2026 at 10:38 pm
    1. "Hello !" is an array of type char const[8] and value { 'H', 'e', 'l', 'l', 'o', ' ', '!', 0 }. pStr is a pointer to its first element; its last element has the value 0.

    2. There is an overload in the iostreams library for a char const * argument, which treats the ar­gu­ment as a pointer to the first element of an array and prints every element until it encounters a zero. (“Null-ter­mi­nat­ed string” in colloquial parlance.)

    3. Dereferencing the pointer to the first element of an array gives you the first element of the array, i.e. 'H'. This identical to pStr[0].

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

Sidebar

Related Questions

I have learned from various tutorial that If a client can reasonably be expected
I just learned (the hard way) that Java Component s can only have one
I have argument with my friend. He says that I can return a pointer
After reading the answer to this question , I learned that SFINAE can be
In computer science I have learned that .jar files are basically a compressed set
I have learned that we can't instantiate an abstract class. But today i tested
From this question I have learned that they are stored on s3 but we
I have learned that Windows uses UTF-16LE on x86/x64 systems. What about Linux? Which
In my studies, I have learned that if you want to prevent users from
I'm required to write a JCE provider. I have learned that I need to

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.