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

The Archive Base Latest Questions

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

char *sample = String Value; &sample is a pointer to the pointer of String

  • 0
char *sample = "String Value";

&sample is a pointer to the pointer of "String Value"

is the above statement right?

If the above statement right, what is the equivalent of &sample if my declaration is

char sample[] = "String Value"
  • 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-15T06:34:18+00:00Added an answer on May 15, 2026 at 6:34 am

    In the first one, there are two objects being created.

    One is a char * (pointer-to-char) called sample, and the other is an unnamed array of 13 chars containing the characters of the string. In this case, &sample gives the address of the object sample, which is the address of a pointer-to-char – so, a pointer-to-pointer-to-char.

    In the second example, there’s only one object being created; an array of 13 chars called sample, initialised with the characters of the string. In this case, &sample gives the address of the object sample – so, a pointer-to-array-of-13-chars.

    In the second example, there is no “equivalent” to &sample in the first example, in the sense of a pointer-to-pointer-to-char value. This is because there is no pointer-to-char value to take the address of. There is only the array.

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

Sidebar

Related Questions

Sample input string: char *str = 12345.567675; And the desired output if I need
I have a small sample function: #define VALUE 0 int test(unsigned char x) {
Here is a simple function that converts a string to an integer. int str2int(char
How can I concatenate two char columns within a perform screen? example: table sample
I have a web service that returns a raw string of JSON data (sample
What I have: [wstr1] 1 std::wstring value (e.g. (GMT+04:30) Kabul) [str2] 1 char* filled
Very simple example - hoping for a simple solution: char x[7]; if(fgets(x,5,stdin)) printf(y); else
I have a very simple class with some char* members. Is strcat the best
i need to do a simple loop in php to get char from a
I have a simple C function which I declare as: int strLen(const char* str_)

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.