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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:59:32+00:00 2026-06-04T20:59:32+00:00

I have in my c++ code: typedef vector<int> cards; typedef vector<cards> rows; typedef vector<rows>

  • 0

I have in my c++ code:

  typedef vector<int> cards;
  typedef vector<cards> rows;
  typedef vector<rows> matriz;

and in my int main() , i try to initilizate a matriz called “cartas” with this line;

  63  cin>>n>>m;
  66  cartas(n,rows(m, cards(0)));

but, with g++, get out this error:

flip.cpp: In function ‘int main()’:
flip.cpp:66: error: no match for call to ‘(matriz) (int&, rows)’

i want to take a matriz of n*m, where in each position, there is vector of integers.

thanks, now, i don’t see it how.

  • 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-04T20:59:33+00:00Added an answer on June 4, 2026 at 8:59 pm

    Is your code by any chance similar to:

    int n, m;
    matriz cartas;
    cin>>n>>m;
    cartas(n,rows(m, cards(0)));
    

    ?

    That won’t work, matriz cartas; is already an initialization. Either define cartaz after the cin statement, or assign afterwards.

    Optimal:

    int n, m;
    cin>>n>>m;
    matriz cartas(n,rows(m, cards(0)));
    

    Alternative:

    int n, m;
    matriz cartas;
    cin>>n>>m;
    cartas = matriz(n,rows(m, cards(0)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: typedef vector<int> Vec; typedef vector<Vec> VecOfVec; template<typename Vec> Vec
I have the following C++ code: typedef istream_iterator<string> isi; // (1) vector<string> lineas(isi(cin), isi());
In sample code, I have seen this: typedef enum Ename { Bob, Mary, John}
I have the following code #include <algorithm> #include <iostream> #include <vector> #include <functional> int
Please consider the following piece of code: int main() { typedef boost::ptr_vector<int> ptr_vector; ptr_vector
I have the following typedef's in my code: typedef unsigned long int ulint; typedef
I have the following C code: typedef void (*mycallback) (char buf[128]); void take_callback(mycallback cb)
I came across the following weird chunk of code.Imagine you have the following typedef:
I have code that looks like this: template<class T> class list { public: class
I have code that I want to look like this: List<Type> Os; ... foreach

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.