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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:53:00+00:00 2026-06-13T09:53:00+00:00

i have a function that generates randomize numbers between 0 and 2,and i want

  • 0

i have a function that generates randomize numbers between 0 and 2,and i want to use pointers but anyway i could not executed it.
First i generate randomize number and then i want to print the multidimensional array to see what it has generated
i just want to assign randomized number to an array(with using pointers) and then print them using pointers again

int **RandomizedMatrix; //integer multidimensional array        
int ***AdressOfMatrix =  &RandomizedMatrix; //assigning the adress of matrix to an integer pointer

void RandomizedMatrixGenerator(int LineNumber,int ColumnNumber,int ***AdressOfMatrix)
{            
    int i,j;
    for (i=0; i<LineNumber*ColumnNumber; i++)
    {
        **AdressOfMatrix = rand()%2;        
    }
    for (i=0; i<LineNumber; i++)
    {
        for (j=0; j<ColumnNumber; j++) 
        {                    
           printf("%d",***(AdressOfMatrix+i)+j);
        }
        printf("\n");
    }
}
  • 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-06-13T09:53:01+00:00Added an answer on June 13, 2026 at 9:53 am

    If what i understand is right you want to fill your 2 dimensional array with 1s and 0s so you can do that

        void randmtrgen(int row,int column,int **mtr){
        int i,j;
        for (i=0;i<row;i++){
            for (j=0;j<column;j++){
                mtr[row][column]=rand()%1+1;
                }
            }
        }
    

    That will fill your matrix as you wish and i suggest you to not use dereference operator if you are not good with it square brackets mostly fine.
    And if you have an urge to use dereference operator you can use that line

        *(*(mtr+row)+column)=rand()%1+1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function 'generateRan' that generates random numbers. This function can not be
I have a function that generates Fibonacci numbers: let rec fib n = match
I want to call a function that generates a function, but I don't know
I have a function that generates a key of 4 characters that has to
I have a function that generates normal random number matrix having normal distribution using
I'll start off with a solid example: I have a function that generates hashes
I have a function that generates a MD5 hash in C# like this: MD5
I want to manually have a function that creates a MIDI file according to
I have written a function that checks if to files are duplicates or not.
I have a function that generates a dropdown based on a query or array

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.