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

The Archive Base Latest Questions

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

A brief question to do mainly with understanding how pointers work with arrays in

  • 0

A brief question to do mainly with understanding how pointers work with arrays in this example:

char *lineptr[MAXLENGTH]

Now I understand this is the same as char **lineptr as an array in itself is a pointer.

My question is how it works in its different forms/ de-referenced states such as:

lineptr
*lineptr
**lineptr
*lineptr[]

In each of those states, whats happening, what does each state do/work as in code?

Any help is much appreciated!

  • 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-27T19:34:18+00:00Added an answer on May 27, 2026 at 7:34 pm

    Now I understand this is the same as char **lineptr as an array in itself is a pointer.

    No, an array is not the same as a pointer. See the C FAQ: http://c-faq.com/aryptr/index.html.

    lineptr
    

    This is the array itself. In most situations, it decays into a pointer to its first element (i.e. &lineptr[0]). So its type is either int *[MAXLENGTH] or int **.

    *lineptr
    

    This dereferences the pointer to the first element, so it’s the value of the first element (i.e. it’s the same as lineptr[0]). Its type is int *.

    **lineptr
    

    This dereferences the first elements (i.e. it’s the same as *lineptr[0]). Its type is int.

    *lineptr[]
    

    I don’t think this is valid syntax (in this context).

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

Sidebar

Related Questions

In brief, my question is about member variables as pointers in unmanaged C++. In
Brief question, beginner's work on Ruby/Rails. Here's my view: <h1>News</h1> <%= @posts.each do |post|
I'll try and make this question as brief as possible. I was wondering if
I'm new to PHP, so this question might best be answered by a brief
Brief version of my question: This code crashes the compiler. pThread[0] = new boost::thread(
This maybe a bit of a 'wide' question, but am putting together a brief
This question is based off of the same app/source from my previous question which
My first question here so let's be brief. I am parsing this site: http://78.133.214.226/fotoweb/Grid.fwx
For example, if I have this: $('#button').click(function() { $.get('/question', function(data) { $('#question').html(data); $('#question').dialog( ...
Brief question What command can I use to make my DataSet refresh it's connection

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.