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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:33:12+00:00 2026-06-07T13:33:12+00:00

I am working in C trying to tokenize an array and then store the

  • 0

I am working in C trying to tokenize an array and then store the tokens to a global array of strings. The catch is that i am trying to do this with pointers so I do not have to refrence the index of the array of strings. I know how big the array is supposed to be which is why it is easy to do it with the index, HOWEVER; i am trying to do this with just pointers. I don’t know if this is possible so correct me here. Here is the code I have tried to implement but not been successful..

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

            char *cPayload2[PARAMS];

    void ReadIn2(char *input)
    {
        //Initialize the pointer to the 
        char *PayloadPtr;
        //start the parse
        char *token = strtok(input, "#");
        //pointer to an array of strings(pointers to character arrays)
        PayloadPtr = &cPayload2[0];

        while(token != NULL)
        {

This is the part in question, can i change the index of my global array with a clause like this. It seems I cannot print out the payload array with this.

            *PayloadPtr = token;
            //increment the index that the ptr refrences
            PayloadPtr++;
            //tokenize again
            token = strtok(NULL, "#");
        }

    }



    int main(void)
    {

        char input[] = "jsiUjd3762BNK==#KOIDKKkdkdwos==";

        ReadIn2(input);

This printout is bunked for some reason

        printf("%s\n",cPayload2[0]);
        printf("%s\n",cPayload2[1]);

        return 0;
    }

Any tips would be greatly appriciated.

  • 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-07T13:33:13+00:00Added an answer on June 7, 2026 at 1:33 pm
    char *PayloadPtr;
    

    should be

    char **PayloadPtr;
    

    apart from that, your code is alright.

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

Sidebar

Related Questions

I have been working in trying to optimize a webservice that is required to
What i'm trying to do is create a template array class that will store
So I have been working and trying for a couple of hours. I am
Im trying to get debugging working without an app.config. I have the following code:
I am very new to javascript and ajax/jquery and have been working on trying
I have been working on trying to leverage data contained in an Access Database
I have a little sample application I was working on trying to get some
I have a more complicated function that I am working on. I want to
I have been working on trying to pull friends birthdays from the facebook API
I'm working on trying to have my project automatically build two different versions of

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.