Repository navigation
Is the following compound literal-like code output correct or not?
#3641
Replies: 3 comments
|
Seems intended, as it is a slice you're printing, so it gets printed as a list instead of just a single element. |
0 replies
|
Clearer example: import std;
fn void main() {
int[] x = { 1, 2, 3 };
io::printn(x);
}Prints: |
0 replies
|
I can confirm that my example is indeed a compound literal! https://c3-lang.org/implementation-details/specification/#compound-literals And indeed as you have said it's a slice of Example code Thank you @BWindey for your replies! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have tried the following code
and produced the following output:
[Hello].Is this the expected output or not?
If yes, why does it get enclosed in
[]?All reactions