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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:05:31+00:00 2026-05-30T02:05:31+00:00

I am new to C, and things are different in C than in any

  • 0

I am new to C, and things are different in C than in any other language I’ve learned. In my homework I want to create an array of chars which point to an array of chars, but rather than make a multidimensional char array, I figure I’d have more control and create char arrays and put each individual one into the indexes of the original char array:

char keywords[10];
keywords[0] = "float";

The above example is to clarify and a simple case. But my question is due to the research I’ve been doing, and I am confused about something. Normally this would work in other languages, but in C it would be:

char *keyword[10];
keywords[0] = "float";

But when I want to send it through a function, why is this necessary:

void function(char **keyword); //function prototype

Wouldn’t just passing the array pointer be enough?

  • 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-30T02:05:31+00:00Added an answer on May 30, 2026 at 2:05 am

    It looks like you’re confused by the double stars in

    void function(char ** keyword);
    

    The double stars just means that this function expects you to pass a pointer to a pointer to a char. This syntax doesn’t include any information about the fact that you are using an array, or that the char is actually the first char of many in a string. It’s up to you as the programmer to know what kind of data structure this char ** actually points to.

    For example, let’s suppose the beginning of your array is stored at address 0x1000. The keyword argument to the function should have a value of 0x1000. If you dereference keyword, you get the first entry in the array, which is a char * that points to the first char in the string “float”. If you dereference the char *, you get the char “f”.

    The (contrived) code for that would look like:

    void function(char **keyword)
    {
        char * first_string = *keyword;   // *keyword is equivalent to keyword[0]
        char first_char = *first_string;  // *first_string is equivalent to first_string[0]
    }
    

    There were two pointers in the example above. By adding an offset to the first pointer before dereferencing it, you can access different strings in the array. By adding an offset to the second pointer before dereferencing it, you can access different chars in the string.

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

Sidebar

Related Questions

I am trying new things with arrays and having some difficulty. I am trying
I have started to look into python and am trying to grasp new things
I am having some confusion with the new keyword,things work fine when I am
I am struggling with an Android app to handle things new to me. I
it should submit form, :driver => :webkit do visit '/things/new' page.should have_content('Login') fill_in 'user_login',
I am new to all things maven and ignition. I am attempting to set
I'm kind of new to these things. I do not know what command line
Given this code: List<string> things = new List<string>(); foreach (string thing in things) {
New to PHP and MySQL, have heard amazing things about this website from Leo
There are some things that I do a lot in a new project, for

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.