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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:33:39+00:00 2026-05-10T17:33:39+00:00

Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that

  • 0

Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that looks like this:

{ { '(SAME', 'AS', 'U+4E18)', 'HILLOCK', 'OR', 'MOUND'}, { 'TO', 'LICK;', {1, 1, 0}, 'TASTE,', 'A', 'MAT,', 'BAMBOO', 'BARK'}, { '(J)', 'NON-STANDARD', 'FORM', 'OF', 'U+559C', ',', {1, 1, 0}, 'LIKE,', 'LOVE,', 'ENJOY;', {1, 1, 4}, 'JOYFUL', 'THING'}, { '(AN', 'ANCIENT', {1, 2, 2}, {1, 2, 3}, 'U+4E94)', 'FIVE'},  ... } 

What’s the best way to declare this? I’ve tried things like

char * abbrevs3[22399][] = { ... }; 

and

char * abbrevs3[22399][][] = { ... }; 

but the compile whinges something chronic.

EDIT: The data is a database of descriptions of certain Unihan characters. I’ve been exploring various ways of compacting the data. As it stands you have 22399 entries, each of which may contain a varying number of strings, or triplets of { abbrev marker, line where last seen, element of that line where last seen }.

By the way Greg’s talking, I may need to have each line contain the same number of elements, even if some of them are empty strings. Is that the case?

EDIT #2: And it occurs to me that some of the numeric values in the triplets are way outside the limits of char.

  • 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. 2026-05-10T17:33:40+00:00Added an answer on May 10, 2026 at 5:33 pm

    I just read your new posts and re-read the original post, and I think I just fully understood the goal here. Sorry it took so long, I’m kind of slow.

    To paraphrase the question, on line 4 of the original example:

    { '(AN', 'ANCIENT', {1, 2, 2}, {1, 2, 3}, 'U+4E94)', 'FIVE'}, 

    You’d want to translate the triples into references to strings used earlier, in an attempt to compress the data. That line becomes:

    { '(AN', 'ANCIENT', 'FORM', 'OF', 'U+4E94)', 'FIVE'}, 

    If the goal is compression I don’t think you’ll see much gain here. The self-referencing triples are each 3 bytes, but the strings that are being substituted out are only 8 bytes total, counting null terminators, and you only save 2 bytes on this line. And that’s for using chars. Since your structure is so big that you’re going to need to use ints for references, your triple is actually 12 bytes, which is even worse. In this case you’ll only ever save space by substituting for words that are 12 ascii characters or more.

    If I’m totally off base here then feel free to ignore me, but I think the approach of tokenizing on spaces and then removing duplicate words is just kind of a poor man’s Huffman compression. Huffman where the alphabet is a list of longest common substrings, or some other standard text compression method would probably work well for this problem.

    If for some reason this isn’t an option though, I think I would get a list of all unique words in your data and use that as a lookup table. Then store all strings as a list of indexes into that table. You’d have to use two tables, but in the end it might be simpler, and it would save you the space being used by the leading 1’s you’re using as the ‘abbrev marker’ now. Basically, your abbreviation markers would become a single index instead of a triplet.

    So,

    const char * words[] = {     'hello', 'world', 'goodbye', 'cruel'     };  const int strings[] = {     { 0, 1 },     { 2, 3, 1 }     }; 

    You’d still lose a lot of space if your strings aren’t of roughly uniform length though.

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

Sidebar

Related Questions

I have a C# program with output that looks like this (unexpanded rows): and
Assuming that I have this: enum { A = 0x2E, B = 0x23, C
1. Assuming that you don't have Visual Studio installed and you want to use
Assuming I have a ASP.NET MVC 3 application that runs in a web farm
I have a Silverlight 3 project with something like this: <ItemGroup> <Content Include=Content\image1.png> </Content>
I am still relatively new at VB.Net and Visual Studio and I'm assuming that
So I have this annoying issue with Visual Studio (when working with C#), I've
Using .Net framework 4. I am assuming this log4net version that the PayPal library
Assuming I have some object like, with LOTS of properties: public class SomeObject {
Assuming I have a numerical string: var foo = 0; Assume I want to

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.