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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:35:00+00:00 2026-05-28T23:35:00+00:00

What I require is similar to array but for random numbers rather than (0,1,2,3…..).

  • 0

What I require is similar to array but for random numbers rather than (0,1,2,3…..).
I need to hold a number as the index/key and assign it a string.

For example student number, and then there name
So I could access students[number] and retrieve their name.

Similar to this code below but its in C++ and im using ANSI C

std::map <string, char> grade_list;
grade_list["John"] = 'B'

which was found here: http://www.cprogramming.com/tutorial/stl/stlmap.html

I just cant seem to find away to solve this problem in ANSI C.

Can any one reccommend any way to produce this?

EDIT: Another point is the values of the table will be hard coded and do not required to be change so it’s just a method with provides access to similar to…

name[accesskey] would return a string/data

GLIBS wont work because I’m using the compiler MINGW32 and there’s problems using it.

  • 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-28T23:35:00+00:00Added an answer on May 28, 2026 at 11:35 pm

    You can use GLib Hash table data structure.

    http://developer.gnome.org/glib/2.30/glib-Hash-Tables.html

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

Sidebar

Related Questions

So I know there have been a number of similar posts, but I think
I've already asked a similar question but this is slightly different so i Thought
Similar to this thread for C# , I need to split a string containing
I am looking for a C++ data type similar to std::vector but without the
I'm trying to index large 3D arrays using a 2D array of indicies from
I tried to search for something similar in the web but no results. What
I've looked and found several similar questions but can't seem to make the solutions
Shortly i have string variable similar to this:(every li elements is array element.) <li>first</li>
I am required to implement a functionality similar to SO voting. I tried to
i have something that requires a matrix of values, similar to pokemon: (source: firechao.com

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.