Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Const Return Test
//g++ 5.4.0 #include <array> #include <cstdint> #include <cstdio> class Test { public: std::array<uint8_t, 4> arr; Test() : arr( { 1, 2, 3, 4 } ) {} uint8_t const* buf( uint8_t i = 0 ) const { return &arr.at( i ); } }; // class Test int main() { Test t; printf( "%d %d %d %d\n", *t.buf( 0 ), *t.buf( 1 ), *t.buf( 2 ), *t.buf( 3 ) ); // t.buf()[0] = 9; // uncomment to see error return 0; }
run
|
edit
|
history
|
help
0
Regression Line
Matrix rotation
Yo que se
1st
pyramid
Stream5
Tray
TempQuickDoubArray
NumType
candies problem