Array in c++ has many errors Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!What are the differences between a pointer variable and a reference variable in C++?How can I profile C++ code running on Linux?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?Easiest way to convert int to string in C++C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Why is reading lines from stdin much slower in C++ than Python?Why is it faster to process a sorted array than an unsorted array?Initialising std::array problems

Can gravitational waves pass through a black hole?

.bashrc alias for a command with fixed second parameter

Fit odd number of triplets in a measure?

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

How can I list files in reverse time order by a command and pass them as arguments to another command?

Simple Line in LaTeX Help!

Was the pager message from Nick Fury to Captain Marvel unnecessary?

How does the body cool itself in a stillsuit?

The test team as an enemy of development? And how can this be avoided?

Why do C and C++ allow the expression (int) + 4*5?

Is the time—manner—place ordering of adverbials an oversimplification?

Vertical ranges of Column Plots in 12

How to make an animal which can only breed for a certain number of generations?

Table formatting with tabularx?

Why is there so little support for joining EFTA in the British parliament?

What is a more techy Technical Writer job title that isn't cutesy or confusing?

Why does BitLocker not use RSA?

My mentor says to set image to Fine instead of RAW — how is this different from JPG?

Plotting a Maclaurin series

What are some likely causes to domain member PC losing contact to domain controller?

"Destructive power" carried by a B-52?

Is this Kuo-toa homebrew race balanced?

Does the Rock Gnome trait Artificer's Lore apply when you aren't proficient in History?

How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?



Array in c++ has many errors



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!What are the differences between a pointer variable and a reference variable in C++?How can I profile C++ code running on Linux?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?Easiest way to convert int to string in C++C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Why is reading lines from stdin much slower in C++ than Python?Why is it faster to process a sorted array than an unsorted array?Initialising std::array problems



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-5















So I have the following lines of code that has many errors but I cant seem to find out how to fix it. The errors shown says that there are too many initializers and that the array must be initialized with a brace enclosed initializer. Can any one help??



const std::array<std::array<int, 3>, 8> m_rows =

0,3,6,
1,4,7,
2,5,8,
0,1,2,
3,4,5,
6,7,8,
0,4,8,
2,4,6
;









share|improve this question



















  • 2





    No repro

    – πάντα ῥεῖ
    Mar 9 at 1:04







  • 1





    both clang and gcc compile this without a problem

    – bolov
    Mar 9 at 1:04











  • and please post the exact error message. Copy-paste is just a click away :)

    – bolov
    Mar 9 at 1:06











  • Warning with clang Demo.

    – Jarod42
    Mar 9 at 1:08











  • @Jarod42 oh, ok. So since clang-6 they removed the warning

    – bolov
    Mar 9 at 1:10

















-5















So I have the following lines of code that has many errors but I cant seem to find out how to fix it. The errors shown says that there are too many initializers and that the array must be initialized with a brace enclosed initializer. Can any one help??



const std::array<std::array<int, 3>, 8> m_rows =

0,3,6,
1,4,7,
2,5,8,
0,1,2,
3,4,5,
6,7,8,
0,4,8,
2,4,6
;









share|improve this question



















  • 2





    No repro

    – πάντα ῥεῖ
    Mar 9 at 1:04







  • 1





    both clang and gcc compile this without a problem

    – bolov
    Mar 9 at 1:04











  • and please post the exact error message. Copy-paste is just a click away :)

    – bolov
    Mar 9 at 1:06











  • Warning with clang Demo.

    – Jarod42
    Mar 9 at 1:08











  • @Jarod42 oh, ok. So since clang-6 they removed the warning

    – bolov
    Mar 9 at 1:10













-5












-5








-5


1






So I have the following lines of code that has many errors but I cant seem to find out how to fix it. The errors shown says that there are too many initializers and that the array must be initialized with a brace enclosed initializer. Can any one help??



const std::array<std::array<int, 3>, 8> m_rows =

0,3,6,
1,4,7,
2,5,8,
0,1,2,
3,4,5,
6,7,8,
0,4,8,
2,4,6
;









share|improve this question
















So I have the following lines of code that has many errors but I cant seem to find out how to fix it. The errors shown says that there are too many initializers and that the array must be initialized with a brace enclosed initializer. Can any one help??



const std::array<std::array<int, 3>, 8> m_rows =

0,3,6,
1,4,7,
2,5,8,
0,1,2,
3,4,5,
6,7,8,
0,4,8,
2,4,6
;






c++ c++11






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 1:07









Jarod42

120k12105189




120k12105189










asked Mar 9 at 1:00









HexxHexx

42




42







  • 2





    No repro

    – πάντα ῥεῖ
    Mar 9 at 1:04







  • 1





    both clang and gcc compile this without a problem

    – bolov
    Mar 9 at 1:04











  • and please post the exact error message. Copy-paste is just a click away :)

    – bolov
    Mar 9 at 1:06











  • Warning with clang Demo.

    – Jarod42
    Mar 9 at 1:08











  • @Jarod42 oh, ok. So since clang-6 they removed the warning

    – bolov
    Mar 9 at 1:10












  • 2





    No repro

    – πάντα ῥεῖ
    Mar 9 at 1:04







  • 1





    both clang and gcc compile this without a problem

    – bolov
    Mar 9 at 1:04











  • and please post the exact error message. Copy-paste is just a click away :)

    – bolov
    Mar 9 at 1:06











  • Warning with clang Demo.

    – Jarod42
    Mar 9 at 1:08











  • @Jarod42 oh, ok. So since clang-6 they removed the warning

    – bolov
    Mar 9 at 1:10







2




2





No repro

– πάντα ῥεῖ
Mar 9 at 1:04






No repro

– πάντα ῥεῖ
Mar 9 at 1:04





1




1





both clang and gcc compile this without a problem

– bolov
Mar 9 at 1:04





both clang and gcc compile this without a problem

– bolov
Mar 9 at 1:04













and please post the exact error message. Copy-paste is just a click away :)

– bolov
Mar 9 at 1:06





and please post the exact error message. Copy-paste is just a click away :)

– bolov
Mar 9 at 1:06













Warning with clang Demo.

– Jarod42
Mar 9 at 1:08





Warning with clang Demo.

– Jarod42
Mar 9 at 1:08













@Jarod42 oh, ok. So since clang-6 they removed the warning

– bolov
Mar 9 at 1:10





@Jarod42 oh, ok. So since clang-6 they removed the warning

– bolov
Mar 9 at 1:10












1 Answer
1






active

oldest

votes


















2














You might need extra :



const std::array<std::array<int, 3>, 8> m_rows =

0,3,6,
1,4,7,
2,5,8,
0,1,2,
3,4,5,
6,7,8,
0,4,8,
2,4,6
;





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072972%2farray-in-c-has-many-errors%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    You might need extra :



    const std::array<std::array<int, 3>, 8> m_rows =

    0,3,6,
    1,4,7,
    2,5,8,
    0,1,2,
    3,4,5,
    6,7,8,
    0,4,8,
    2,4,6
    ;





    share|improve this answer



























      2














      You might need extra :



      const std::array<std::array<int, 3>, 8> m_rows =

      0,3,6,
      1,4,7,
      2,5,8,
      0,1,2,
      3,4,5,
      6,7,8,
      0,4,8,
      2,4,6
      ;





      share|improve this answer

























        2












        2








        2







        You might need extra :



        const std::array<std::array<int, 3>, 8> m_rows =

        0,3,6,
        1,4,7,
        2,5,8,
        0,1,2,
        3,4,5,
        6,7,8,
        0,4,8,
        2,4,6
        ;





        share|improve this answer













        You might need extra :



        const std::array<std::array<int, 3>, 8> m_rows =

        0,3,6,
        1,4,7,
        2,5,8,
        0,1,2,
        3,4,5,
        6,7,8,
        0,4,8,
        2,4,6
        ;






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 9 at 1:03









        Jarod42Jarod42

        120k12105189




        120k12105189





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072972%2farray-in-c-has-many-errors%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко