Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Multiple inheritance of empty classes - sizeof
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
#include <iostream> struct A {}; struct B {}; struct C: A, B {}; struct Range: C {float* begin; float* end;}; //static_assert(sizeof(Range)==sizeof(float*)*2, "ERROR"); int main() { std::cout << "sizeof(float*)" << sizeof(float*) << std::endl; std::cout << "sizeof(A) == " << sizeof(A) << std::endl; std::cout << "sizeof(B) == " << sizeof(B) << std::endl; std::cout << "sizeof(C) == " << sizeof(C) << std::endl; std::cout << "sizeof(Range) == " << sizeof(Range) << std::endl; }
cl.exe
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 1,68 sec, absolute running time: 0,44 sec, absolute service time: 2,12 sec
fork mode
|
history
|
discussion