Why I cannot initialize variables with curly braces in Visual Studio Code? [duplicate]
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;
c++
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.
add a comment |
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;
c++
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
add a comment |
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;
c++
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;
This question already has an answer here:
Compiling C++11 with g++
5 answers
c++
c++
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
int a = 0;
int a = 0;
int a[2] = 0,1;
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
int a = 0;
int a = 0;
int a[2] = 0,1;
add a comment |
int a = 0;
int a = 0;
int a[2] = 0,1;
add a comment |
int a = 0;
int a = 0;
int a[2] = 0,1;
int a = 0;
int a = 0;
int a[2] = 0,1;
edited Nov 14 '18 at 3:15
songyuanyao
92.1k11175240
92.1k11175240
answered Nov 14 '18 at 3:11
user10649559user10649559
1
1
add a comment |
add a comment |
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