Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Initializing member array of structs
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> struct MyStruct { int x; int y; }; class MyClass { public: MyClass() : s { } { } /*MyClass() : s { {1, 2}, { 3, 4} } { }*/ void print() { std::cout << s[0].x << std::endl; std::cout << s[0].y << std::endl; std::cout << s[1].x << std::endl; std::cout << s[1].y << std::endl; } private: MyStruct s[2]; }; int main() { MyClass c; c.print(); }
cl.exe
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 1,92 sec, absolute running time: 0,22 sec, absolute service time: 2,15 sec
edit mode
|
history
|
discussion
0 0 0 0