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

  • Home
  • SEARCH
  • 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 839563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:29:02+00:00 2026-05-15T05:29:02+00:00

I am having problems with array pointers. I’ve looked through Google and my attempts

  • 0

I am having problems with array pointers. I’ve looked through Google and my attempts are futile so far.

What I would like to do is, I have a char name[256]. I will be 10 of those.
Hence, I would need to keep track of each of them by pointers.

Trying to create a pointer to them.

int main()
{
    char superman[256] = "superman";
    char batman[256] = "batman";
    char catman[256] = "catman";
    char *names[10];
    names[0] = superman;
    names[1] = batman;
    system("pause");
    return 0;
}

How do I actually traverse an array of pointers?

  • 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-15T05:29:04+00:00Added an answer on May 15, 2026 at 5:29 am

    why not use strings and a Vector of strings to store the names?
    smpl:

    #include <string>
    #include <iostream>
    #include <Vector>
    
    //using namespace std;
    
    int main(void) {
        std::string superman = "superman";
        std::string batman = "batman";
        std::vector<std::string> names;
        names.push_back(superman);
        names.push_back(batman);
        for (unsigned int i = 0; i < names.size(); ++i) {
            std::cout << names[i] << std::endl;
        }
        char c; std::cin >> c;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems building an hierarchistic array structure - I have almost got
I'm having a few problems with some Objective-C and would appreciate some pointers. So
I'm writing a C program but I keep having problems with my array of
im having problems on how to save the content of an array in an
I am having problems passing a javascript array to an MVC3 controller, not sure
Hi I am having a problems displaying my array via JSON object. I passed
I'm having problems to iterate twice on the same array: <? $indice=0 ?> <?php
I'm having problems getting values in my multidimensional arrays Array ( [0] => Array
I'm having problems uploading files with CodeIgniter 2.1.0, as I recieve the $_FILES array
I'm having a lot of problems initializing an array of bools. When using the

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.