Why I cannot initialize variables with curly braces in Visual Studio Code? [duplicate]










0
















This question already has an answer here:



  • Compiling C++11 with g++

    5 answers



I don't know why Visual Studio Code and g++ expect a semicolon after a curly braces initialization of a variable. The program is below.



#include<iostream>

int main()

int i0; // Semi colon expected here??
return 0;



Error










share|improve this question















marked as duplicate by Ken Y-N, Ken White, Community Nov 14 '18 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    This answer may be useful to you, good luck!

    – Agustín Clemente
    Nov 14 '18 at 2:20






  • 2





    Either update your GCC installation or add -std=c++11 to your compiler option

    – Guillaume Racicot
    Nov 14 '18 at 2:24











  • Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

    – Cris Luengo
    Nov 14 '18 at 5:22











  • @CrisLuengo Good point. Will keep in mind these issues. Merci.

    – Jash
    Nov 14 '18 at 12:22















0
















This question already has an answer here:



  • Compiling C++11 with g++

    5 answers



I don't know why Visual Studio Code and g++ expect a semicolon after a curly braces initialization of a variable. The program is below.



#include<iostream>

int main()

int i0; // Semi colon expected here??
return 0;



Error










share|improve this question















marked as duplicate by Ken Y-N, Ken White, Community Nov 14 '18 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    This answer may be useful to you, good luck!

    – Agustín Clemente
    Nov 14 '18 at 2:20






  • 2





    Either update your GCC installation or add -std=c++11 to your compiler option

    – Guillaume Racicot
    Nov 14 '18 at 2:24











  • Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

    – Cris Luengo
    Nov 14 '18 at 5:22











  • @CrisLuengo Good point. Will keep in mind these issues. Merci.

    – Jash
    Nov 14 '18 at 12:22













0












0








0









This question already has an answer here:



  • Compiling C++11 with g++

    5 answers



I don't know why Visual Studio Code and g++ expect a semicolon after a curly braces initialization of a variable. The program is below.



#include<iostream>

int main()

int i0; // Semi colon expected here??
return 0;



Error










share|improve this question

















This question already has an answer here:



  • Compiling C++11 with g++

    5 answers



I don't know why Visual Studio Code and g++ expect a semicolon after a curly braces initialization of a variable. The program is below.



#include<iostream>

int main()

int i0; // Semi colon expected here??
return 0;



Error





This question already has an answer here:



  • Compiling C++11 with g++

    5 answers







c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 5:43









Dave

434




434










asked Nov 14 '18 at 2:16









JashJash

184




184




marked as duplicate by Ken Y-N, Ken White, Community Nov 14 '18 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Ken Y-N, Ken White, Community Nov 14 '18 at 12:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1





    This answer may be useful to you, good luck!

    – Agustín Clemente
    Nov 14 '18 at 2:20






  • 2





    Either update your GCC installation or add -std=c++11 to your compiler option

    – Guillaume Racicot
    Nov 14 '18 at 2:24











  • Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

    – Cris Luengo
    Nov 14 '18 at 5:22











  • @CrisLuengo Good point. Will keep in mind these issues. Merci.

    – Jash
    Nov 14 '18 at 12:22












  • 1





    This answer may be useful to you, good luck!

    – Agustín Clemente
    Nov 14 '18 at 2:20






  • 2





    Either update your GCC installation or add -std=c++11 to your compiler option

    – Guillaume Racicot
    Nov 14 '18 at 2:24











  • Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

    – Cris Luengo
    Nov 14 '18 at 5:22











  • @CrisLuengo Good point. Will keep in mind these issues. Merci.

    – Jash
    Nov 14 '18 at 12:22







1




1





This answer may be useful to you, good luck!

– Agustín Clemente
Nov 14 '18 at 2:20





This answer may be useful to you, good luck!

– Agustín Clemente
Nov 14 '18 at 2:20




2




2





Either update your GCC installation or add -std=c++11 to your compiler option

– Guillaume Racicot
Nov 14 '18 at 2:24





Either update your GCC installation or add -std=c++11 to your compiler option

– Guillaume Racicot
Nov 14 '18 at 2:24













Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

– Cris Luengo
Nov 14 '18 at 5:22





Please don't post screen shots of code or error messages. You can easily copy-paste them into the question. Images are not accessible to everyone and are not searchable.

– Cris Luengo
Nov 14 '18 at 5:22













@CrisLuengo Good point. Will keep in mind these issues. Merci.

– Jash
Nov 14 '18 at 12:22





@CrisLuengo Good point. Will keep in mind these issues. Merci.

– Jash
Nov 14 '18 at 12:22












1 Answer
1






active

oldest

votes


















0














int a = 0;

int a = 0;

int a[2] = 0,1;





share|improve this answer































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    int a = 0;

    int a = 0;

    int a[2] = 0,1;





    share|improve this answer





























      0














      int a = 0;

      int a = 0;

      int a[2] = 0,1;





      share|improve this answer



























        0












        0








        0







        int a = 0;

        int a = 0;

        int a[2] = 0,1;





        share|improve this answer















        int a = 0;

        int a = 0;

        int a[2] = 0,1;






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 14 '18 at 3:15









        songyuanyao

        92.1k11175240




        92.1k11175240










        answered Nov 14 '18 at 3:11









        user10649559user10649559

        1




        1















            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Syphilis

            Darth Vader #20