Mercurial > hg > octave-lyh
diff src/ov.cc @ 4791:62f2fb593455
[project @ 2004-02-20 18:02:59 by jwe]
author | jwe |
---|---|
date | Fri, 20 Feb 2004 18:02:59 +0000 |
parents | ca3a1d687bba |
children | 499d2ca46982 |
line wrap: on
line diff
--- a/src/ov.cc +++ b/src/ov.cc @@ -1916,6 +1916,22 @@ octave_streamoff::register_type (); } +DEFUN (sizeof, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} sizeof (@var{val})\n\ +Return the size of @var{val} in bytes\n\ +@end deftypefn") +{ + octave_value retval; + + if (args.length () == 1) + retval = args(0).byte_size (); + else + print_usage ("sizeof"); + + return retval; +} + static int warn_fortran_indexing (void) {