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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:38:19+00:00 2026-05-26T02:38:19+00:00

Here is the declaration of the constructor I’m using: _Task Multiplier { int **Z;

  • 0

Here is the declaration of the constructor I’m using:

_Task Multiplier {
    int **Z;
    int **X;
    int **Y;
    int xr, xcols_yrows, yc;
    void main() {
        for( int i = 0; i < xcols_yrows; i++ ) {
            matrixmultiply(Z, X, xr, i, Y, yc);
        }
    }

  public:
    Multiplier( int *Z[], int *X[], int *Y[], int xr, int xcols_yrows, int yc) :
        Z( Z ), X( X ), Y( Y ), xr( xr ), xcols_yrows( xcols_yrows ), yc( yc ) {}

};

And here is where it is used:

int xrows, xcols_yrows, ycols;
// [cols][rows]
int X[xrows][xcols_yrows], Y[xcols_yrows][ycols], Z[xrows][ycols];
// start threads to multiply rows
Multiplier *multipliers[xrows];
for( int r = 0; r < xrows; r++ ) {
    multipliers[r] = new Multiplier( &Z, &X, &Y, r, xcols_yrows, ycols );
}

(they are all initialized)
But I get this weird error:

q3.cc: In member function 'virtual void uMain::main()':
q3.cc:132: error: no matching function for call to 'Multiplier::Multiplier(int (*)[(((unsigned int)(((int)xrows) + -0x00000000000000001)) + 1)][(((unsigned int)(((int)ycols) + -0x00000000000000001)) + 1)], int (*)[(((unsigned int)(((int)xrows) + -0x00000000000000001)) + 1)][(((unsigned int)(((int)xcols_yrows) + -0x00000000000000001)) + 1)], int (*)[(((unsigned int)(((int)xcols_yrows) + -0x00000000000000001)) + 1)][(((unsigned int)(((int)ycols) + -0x00000000000000001)) + 1)], int&, int&, int&)'
q3.cc:37: note: candidates are: Multiplier::Multiplier(int**, int**, int**, int, int, int, UPP::uAction)
q3.cc:26: note:                 Multiplier::Multiplier(Multiplier&)
make: *** [q3.o] Error 1
  • 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-26T02:38:19+00:00Added an answer on May 26, 2026 at 2:38 am

    The problem is that the function parameters X, Y and Z basically expect a array of pointers to int, but you’re giving it a pointer to an array of arrays of int.

    Specifying a parameter as an array (declared with []) decays to declaring a parameter as a pointer. And this is ok, as an array variable can be basically treated as a pointer to the first element of the array.

    This is not valid for n-dimensional arrays, though, as the compiler needs to know how wide the array is along the second dimension in order to calculate the start of the next element along the first dimension… that is, in order to know what location in memory X[1][0] refers to, the compiler needs to know how many elements are in X[0].

    One solution would be to use a pointer to the start of each matrix, and do the address calculations yourself. Such as:

    Multiplier( int *Z, int *X, int *Y, int xr, int xcols_yrows, int yc) :
        Z( Z ), X( X ), Y( Y ), xr( xr ), xcols_yrows( xcols_yrows ), yc( yc ) {}
    // ...
    multipliers[r] = new Multiplier( &Z[0][0], &X[0][0], &Y[0][0], r, xcols_yrows, ycols );
    

    And know that X[i][j] in the calling code is actually X[i*xcols_yrows+j] inside Multiplier.

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

Sidebar

Related Questions

Here's what I want the resulting class declaration to look like: public sealed partial
Trying to compile: class AnonymousClass { public: AnonymousClass(int x) { } }; int main()
I have the following simple constructor: public SimpleClass(Type1 arg1, int interval = 1000) {
Possible Duplicate: Initialize class fields in constructor or at declaration? We are arguing about
Let's say I have the following structure declaration (simple struct with no constructor). struct
I'm going nuts trying to find the problem here. I have a main window,
Here is my code: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct Foo { UInt32 StartAddr;
Assume someClass is a class defined in C# with some method int doSomething(void) ,
I habe read here about defining method for a Javascript class Advantages of using
Here is my situation: I instantiated a c# usercontrol on a main thread, but

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.