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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:22:24+00:00 2026-05-22T12:22:24+00:00

So I have tried to create a generator like: #include <iostream> #include <iomanip> #include

  • 0

So I have tried to create a generator like:

#include <iostream>
#include <iomanip>  
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char* data;
void genRandomFilledChar(char *s, int i, int j, int k) { 
    const char alphanum[] =
        "0123456789"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "abcdefghijklmnopqrstuvwxyz";
    for (int q = 0; q < i; ++q) {
        for (int w = 0; w < j; ++w) {
            for (int e = 0; e < k; ++e) {
                s[e] = alphanum[rand() % (sizeof(alphanum) - 1)];
            }
        } }}

int main()
{
    data =  new char[10000][10000][10000];
    genRandomFilledChar(data, 10000, 10000, 10000);
    cin.get();
    return 0;
}

But it fails to compile. What am I doing wrong?

  • 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-22T12:22:24+00:00Added an answer on May 22, 2026 at 12:22 pm
    char* data;
    // ....
    data =  new char[10000][10000][10000];
    

    Are wrong. First, a three dimensional array of chars is char***. Next, you need to initialize that memory in 3 steps.

    data = new char**[10000];
    for(int i=0; i < 10000; ++i){
      data[i] = new char*[10000];
      for(int j=0; j < 10000; ++j){
        data[i][j] = new char[10000];
        for(int k=0; k < 10000; ++k){
          // and for best performance, initialize directly
          data[i][j][k] = /*HERE*/;
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to find how to create DLL-s on linux using google, but
Hi I want to create a JSON array. I have tried using: JSONArray jArray
I have tried with ado.net create table columnName with unique name. as uniquename I
Have anybody ever tried to create thumbnails/previews of MS Office files? I do not
I have tried FBConnect for iPhone and am able to create/manage sessions and upload
I have development environment with 64-bit SharePoint 2007. I tried to create SharePoint workflow
I like to create a report generation script in Matlab. Suppose we have a
I have created an fbml application. I have tried numerous examples of fbjs but
I have created a small and simple android app. I tried installing it on
I have tried <ul id=contact_list> <li id=phone>Local 604-555-5555</li> <li id=i18l_phone>Toll-Free 1-800-555-5555</li> </ul> with #contact_list

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.