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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:10:34+00:00 2026-05-25T20:10:34+00:00

So, I’ve figured out how to dereference a multidimensional array like this: #include <tchar.h>

  • 0

So, I’ve figured out how to dereference a multidimensional array like this:

#include <tchar.h>
#include <iostream>

wchar_t g_pppwcSymbol[2][3][4];

int main(int argc, TCHAR **argv) 
 {
     (* (*( (*(g_pppwcSymbol+1) )+2 )+3 ) ) = L'K';
     std::wcout<<g_pppwcSymbol[1][2][3];
     std::wcin.get();
     return 0;
 }

Output: K

However, I’ve also heard that the compiler transforms this into a 1-dimensional array, is that correct? This would mean that all the wchar_t elements follow up each other in the memory. So there must be a way to do something like this:

***(g_pppwcSymbol + x) = value;

However I’m not sure how this works exactly. Could someone elaborate?


EDIT:

this seems to work so far:

int main(int argc, TCHAR **argv) 
 {
     /*(* (*( (*(g_pppwcSymbol+1) )+2 ) + 3)) = L'K';*/
     /*std::wcout<<g_pppwcSymbol[1][2][3];*/
     ***(g_pppwcSymbol + 1) = L'K';
     std::wcout<<g_pppwcSymbol[1][0][0];
     std::wcin.get();
     return 0;
 }

output: K


NEXT EDIT:

Working model:

static const int X = 2;
static const int Y = 3;
static const int Z = 4;
wchar_t g_pppwcSymbol[X][Y][Z];

int main(int argc, TCHAR **argv) 
 {
     int iAccess = ((Y*Z) * 1) + ((Z) * 2) + 3;
     *( (**g_pppwcSymbol) +  iAccess) = L'K';
     std::wcout<<g_pppwcSymbol[1][2][3];
     std::wcin.get();
     return 0;
 }

Output: K

  • 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-25T20:10:35+00:00Added an answer on May 25, 2026 at 8:10 pm

    The compiler actually transforms the [] operator into just those mathematical calculations, so you are going about this the hard way… But it’s an interesting exercise so I’ll play along.


    g_pppwcSymbol[2][3][4] is actually a 2 elements large array of 3 elements large array of 4 elements large. Thus,

    g_pppwcSymbol + ((3 * 4) /* size of first level array element */ * 1) + (4 /* size of second level array element */ * 2) + 1 /* size of third level array element */ * 3;
    

    should give you the position of the last item of the last array of the last array. As long as each element is 1 byte large.

    The array simply is a memory area the size of “element_count * element_size and the [] operator takes the array location as a pointer and adds element_size * index. It may contain other arrays since it can compute their sizes the same way as other memory structures.

    BTW, I’m sure you’ll find plenty of documentation about this in details all over the internet.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.