01-18-2016
FWIW,
The original query was not overtly based upon concerns of overhead or performance per se but, rather, [possible?] quote technical differences in compiled result.
The illustrated fragments using sizeof as arguments were in place in an area that was already selective in execution and time and volume did not come into play.
A discussion had started on the merits of an argument vs. a variable and the posting here was more for enlarging the set of opinions. I, too, will often include additional steps etc. in order to make a sequence more clear or to be able to include some step-wise commentary.
The upshot was we (I) left the use of the sizeof as arguments in place as is principally because we (I<g>) didn't have to do anything (Management 101 - 1st precept - do nothing) and because the use was in a block that already well commented leaving no ambiguity.
Thanks.
Geo. Salisbury
Long Valley, NJ
9 More Discussions You Might Find Interesting
1. Programming
we know that sizeof never returns zero when used with structure
then why in this case it is returning zero
struct foo
{
char c;
};
void main()
{
struct foo f;
cout<<sizeof(f);
}
i am working on solaris 5.8
isn't the above function should return the size of empty structure (7 Replies)
Discussion started by: ramneek
7 Replies
2. UNIX for Dummies Questions & Answers
Hi,
we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier).
As a part of this i need to change the CFLAGS.
The xl c/c++ complier CFLAGS is
CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \
-qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies
3. Programming
To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first?
The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's...
Eventhough i... (12 Replies)
Discussion started by: f.ben.isaac
12 Replies
4. Programming
Hi All,
is it possible to find out the size of an array of structures ( without using 'sizeof' operator). The condition is we have the array of structure instant but we are not aware of the elements inside the structure.
Can someone help me out?
Thanks in advance. (18 Replies)
Discussion started by: rvan
18 Replies
5. Programming
The below code throws the error, since the size of x = 19 is not passed to the cstrCopy function.
using namespace std;
static void cstrCopy(char *x, const char*y);
int main ()
{
char x;
const string y = "UNIX FORUM";
cstrCopy(x,y.c_str());
return 0;
}
void cstrCopy(char *x,... (3 Replies)
Discussion started by: SamRoj
3 Replies
6. Programming
Hi,
There are some bewildering sizeof() questions I have in my mind. Could anyone shed some light on this?
int main() {
printf("%d\n", sizeof(main)); // Ans: 1
}
That is, the sizeof() a function identifier though it is treated internally as a pointer gives 1 byte always, why?
... (5 Replies)
Discussion started by: royalibrahim
5 Replies
7. UNIX for Dummies Questions & Answers
hi,
can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also
can we install sun cc compiler in AIX environment and vice versa.
and more ..is linux support cc compiler
regards
Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies
8. Programming
Hi,
I have defined the class and call the sizeof(object to class) to get the size.
# include <iostream>
# include <iomanip>
using namespace std;
class sample
{
private:
int i;
float j;
char k;
public:
sample()
{
} (2 Replies)
Discussion started by: ramkrix
2 Replies
9. Shell Programming and Scripting
Hai
how to find size of a file??
ex : /home/kiran/pdk/sample/calibre this is a path
In that I have to find size of a files in side a calibre(it is the folder) like .results or .summary (1 Reply)
Discussion started by: kiran425
1 Replies
LEARN ABOUT DEBIAN
geo::space
Geo::Space(3pm) User Contributed Perl Documentation Geo::Space(3pm)
NAME
Geo::Space - A collection of various items
INHERITANCE
Geo::Space
is a Geo::Shape
SYNOPSIS
my $island1 = Geo::Line->filled(...);
my $island2 = Geo::Space->new(...);
my $islands = Geo::Space->new($island1, $island2)
DESCRIPTION
Where a Geo::Surface can only contains sets of nested polygons, the Space can contain anything you like: lines, points, and unrelated
polygons.
METHODS
Constructors
$obj->new([COMPONENTS], [OPTIONS])
Geo::Space->new([COMPONENTS], [OPTIONS])
When called as instance method, some defaults are copied from the object where the call is made upon. Usually called as class method.
COMPONENTS are Math::Polygon, Math::Polygon::Surface, Geo::Point, Geo::Line, Geo::Surface, Geo::Space objects.
Option--Defined in--Default
proj Geo::Shape see Geo::Proj::defaultProjection()
. proj => LABEL
Attributes
$obj->component(INDEX, [INDEX, ...])
Returns the component (or components) with the specified INDEX(es). One Geo::Shape object in scalar context, and multiple in list
context.
$obj->components
Returns a list of Geo::Shape objects, all located in this space.
$obj->lines
Returns a list of Geo::Line objects, which are defined as separate components.
$obj->nrComponents
Returns the number of components.
$obj->onlyLines
Returns true when all components are lines; Geo::Line objects.
$obj->onlyPoints
Returns true when all components are points; Geo::Point objects.
$obj->onlyRings
Returns true when all components are closed lines; Geo::Line objects each defined as ring.
$obj->points
Returns a list of Geo::Point objects, which are defined as separate components.
$obj->proj
See "Attributes" in Geo::Shape
$obj->proj4
See "Attributes" in Geo::Shape
Projections
$obj->in(LABEL|'utm')
See "Projections" in Geo::Shape
$obj->projectOn(NICK, POINTS)
See "Projections" in Geo::Shape
Geometry
$obj->area
Returns the area enclosed by the combined components. Only useful when the points are in some orthogonal projection.
$obj->bbox
See "Geometry" in Geo::Shape
$obj->bboxCenter
See "Geometry" in Geo::Shape
$obj->bboxRing([XMIN, YMIN, XMAX, YMAX, [PROJ]])
Geo::Space->bboxRing([XMIN, YMIN, XMAX, YMAX, [PROJ]])
See "Geometry" in Geo::Shape
$obj->distance(OBJECT, [UNIT])
See "Geometry" in Geo::Shape
$obj->perimeter
The length of the outer polygons of all components. Only useful in a orthogonal coordinate systems.
Display
$obj->deg2dm(DEGREES, POS, NEG)
Geo::Space->deg2dm(DEGREES, POS, NEG)
See "Display" in Geo::Shape
$obj->deg2dms(DEGREES, POS, NEG)
Geo::Space->deg2dms(DEGREES, POS, NEG)
See "Display" in Geo::Shape
$obj->dms2deg(DMS)
Geo::Space->dms2deg(DMS)
See "Display" in Geo::Shape
$obj->toString([PROJECTION])
Returns a string representation of the line, which is also used for stringification.
example:
DIAGNOSTICS
Error: distance calculation not implemented between a $kind and a $kind
Only a subset of all objects can be used in the distance calculation. The limitation is purely caused by lack of time to implement
this.
Error: in() not implemented for a $class
SEE ALSO
This module is part of Geo-Point distribution version 0.93, built on May 19, 2010. Website: http://perl.overmeer.net/geo/ All modules in
this suite: "Geo::Point", "Geo::Proj4", "Geo::WKT", "Math::Polygon", "Geo::GML", "Geo::ISO19139", "Geo::EOP", "Geo::Format::Envisat", and
"Geo::Format::Landsat".
Please post questions or ideas to the mailinglist at http://geo-perl@list.hut.fi
LICENSE
Copyrights 2005-2010 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2010-05-19 Geo::Space(3pm)