Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
//#define ARRAY_COUNT( array ) (sizeof( array ) / (sizeof( array[0] //) * (sizeof( array ) != sizeof(void*) || sizeof( array[0] ) <= //sizeof(void*)))) size_t array_count(T)(T array) { return (array.sizeof / (array[0].sizeof * (array.sizeof != (void*).sizeof || array[0].sizeof <= (void*).sizeof) ) ); } import std.stdio; void main() { int[324] i; writeln(array_count(i)); }
Result:
Success
/
Return code: 0
/
Compilation time:
0.332
seconds
/
Run time:
0.001
seconds
Disassembly
Application output:
324
Username
Message
Add comment
Paste info
Author:
nazriel
Views:
269
Private:
no
Expires:
Never
Uploaded:
03.07.12 6:07
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.062
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason