http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* Who gets higher salary a Java Programmer or a C++ Programmer? - 15 messages,
7 authors
http://groups.google.com/group/comp.lang.c++/t/4017272356b778c8?hl=en
* The Java vs C++ higher salary thread - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/be2a8dac2cb503c3?hl=en
* Object pointer casted to int* , wont increment with ++ - 4 messages, 4
authors
http://groups.google.com/group/comp.lang.c++/t/56fc5b72c8602df0?hl=en
* binary format of the number. - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/bf11dd6e68624537?hl=en
* Template copy constructor question. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/3e7e58e58810584a?hl=en
==============================================================================
TOPIC: Who gets higher salary a Java Programmer or a C++ Programmer?
http://groups.google.com/group/comp.lang.c++/t/4017272356b778c8?hl=en
==============================================================================
== 1 of 15 ==
Date: Sat, Nov 29 2008 10:58 am
From: Tom Anderson
On Sat, 29 Nov 2008, Ian Collins wrote:
> Tom Anderson wrote:
>> On Sat, 29 Nov 2008, Ian Collins wrote:
>>
>>> LR wrote:
>>>
>>>> When an engineer designs a bridge, they may for example try to figure
>>>> out how the bridge will react to a given load. They may try this for
>>>> various loads. The load limit is determined by physics.
>>>>
>>>> What is the analogous thing for software?
>>>
>>> The Roman or medieval bridge builder who pre-dated the discovery of
>>> physics?
>>
>> Despite what the Civ2 tech tree may say, the building of bridges by
>> Romans and medievals was not done without the aid of physics. Indeed,
>> the mechanics needed to build bridges, siege engines, and other such
>> staples of the ancient world was well advanced in classical Greece. They
>> didn't have calculus, or quite such an integrated picture of physics,
>> but they had plenty of quantitative rules.
>
> Which is probably where software engineering is now.
>
>>> The Roman or medieval bridge builder was no less of an engineer than
>>> today's bridge builder. If anything he was more of an engineer because
>>> he didn't have machines to do his donkey work for him.
>>
>> The Greeks built tools to calculate cube roots, which were essential to
>> the design of those big spear-throwing siege engines - oxybeles, i seem
>> to remember they're called.
>>
>> Although the mathematics they used was empirical, rather than being
>> based on theory.
>
> Which is probably where software engineering is now.
I don't think so. I don't think we're even at that stage.
>>> Maybe every software application has its own set of physical laws?
>>
>> If so, i don't think they'd qualify as laws, would they?
>
> Why not? For all we know, there might be an infinite number of parallel
> universes each with their own set of physical laws.
True, but we don't build each bridge in a different one. Universality has
long been considered a fundamental requirement for scientific laws.
tom
--
This is your life and it's ending one minute at a time.
== 2 of 15 ==
Date: Sat, Nov 29 2008 11:11 am
From: Tom Anderson
On Sat, 29 Nov 2008, James Kanze wrote:
> On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
>> Kai-Uwe Bux wrote:
>>> LR wrote:
>>> a) There is some tension about where to put math.
>>
>> I didn't think so, but this thread has clarified that for me.
>>
>>> Some place it with the sciences, others don't.
>>
>> I don't.
>
> So you're in a minority of one. All of the standard definitions
> consider it science.
Poppycock. No philosopher of science considers mathematics a science. The
activities of mathematics and science are fundamentally different. Don't
needlessly undermine your own argument by making statements like this.
>> I tend to think of science as dealing with physical phenomena and math
>> dealing with, for lack of a better word, abstraction.
>
> What physical phenomena are involved in such sciences as economic
> science, or psychology, or sociology.
In psychology, it's the array of physical and chemical processes which
underly nerve activity. Neither economics nor sociology is a science.
tom
--
This is your life and it's ending one minute at a time.
== 3 of 15 ==
Date: Sat, Nov 29 2008 12:05 pm
From: James Kanze
On Nov 29, 5:27 pm, LR <lr...@superlink.net> wrote:
> James Kanze wrote:
> > On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
> >> Kai-Uwe Bux wrote:
> >>> LR wrote:
> >>> a) There is some tension about where to put math.
> Not the one's that I've read. Not the one's my teachers taught me.
> > Obviously, if you redefine science, and redefine principles,
> > you can come up with definitions such that software
> > engineering does not use "scientific principles". But
> > that's just playing word games, and doesn't help either
> > understanding nor communication.
> These are the things that I was taught and learned. But
> perhaps the opposite is true? That people are changing the
> definitions of things to suit what they perceive as being
> their self-interest? Do you think that's possible?
More likely you didn't correctly understand what you were being
taught. Any "tension" with regards to mathematics stems from
the supposed absence of experiental investigation. Which means
that large branches of math are science. Practically, of
course, if you want to study science, you enrol in the
scientific section of the university, not in the literary
section.
> >> I tend to think of science as dealing with physical
> >> phenomena and math dealing with, for lack of a better word,
> >> abstraction.
> > What physical phenomena are involved in such sciences as
> > economic science, or psychology, or sociology.
> Assuming that it is in fact a science, I think that in
> economics at least there is the question of the allocation of
> scarce resources (that's from memory, so I might have it
> wrong, I think that's what Sowell said,) and these are
> physical entities. There's also the question of the movement
> of goods and currency. Perhaps we could restate those as
> fluids problems? In an article at a link I posted else thread,
> George Soros used the phrase "financial engineering."
> It's less clear to me, perhaps because I don't know enough
> about them that psychology and sociology are sciences. But I
> suppose if they are able to measure physical phenomena and
> make predictions about them, the way physics can then they'd
> be sciences. Can they do these?
> But I think that we do have to be careful about defining what
> a science is. For example, political pollsters measure things
> and often use them to make predictions. But I'm not sure how
> far I'd go in saying that Political Science is a science.
> Maybe I'm wrong about that. Or if it's not now, maybe one day
> it will be.
You're missing the point. There's nothing in the definition of
science which says that it has to relate to physical phenomena.
The _American Heritage Dictionary_ gives several meanings,
including "The observation, identification, description,
experimental investigation, and theoretical explanation of
phenomena" (nothing about "physical" there; behavioral sciences
are sciences), and "An activity that appears to require study
and method" (which certainly includes mathematics).
> Also, AFAICR all of the sciences have some relation to an
> engineering discipline, or at least off hand I can't think of
> one that doesn't. What engineering disciplines are the three
> things you named related to?
That's it. Make up rules as you go along. Engineering and
science tend to subdivide differently.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
== 4 of 15 ==
Date: Sat, Nov 29 2008 12:06 pm
From: Tom Anderson
On Sat, 29 Nov 2008, James Kanze wrote:
> On Nov 28, 10:42 pm, Tom Anderson <t...@urchin.earth.li> wrote:
>> On Sat, 29 Nov 2008, Ian Collins wrote:
>>> LR wrote:
>
>>>> When an engineer designs a bridge, they may for example try
>>>> to figure out how the bridge will react to a given load.
>>>> They may try this for various loads. The load limit is
>>>> determined by physics.
>
>>>> What is the analogous thing for software?
>
>>> The Roman or medieval bridge builder who pre-dated the
>>> discovery of physics?
>
>> Despite what the Civ2 tech tree may say, the building of
>> bridges by Romans and medievals was not done without the aid
>> of physics. Indeed, the mechanics needed to build bridges,
>> siege engines, and other such staples of the ancient world was
>> well advanced in classical Greece. They didn't have calculus,
>> or quite such an integrated picture of physics, but they had
>> plenty of quantitative rules.
>
> I think that that's really Ian's point. The Romans didn't have
> modern physics, but that didn't mean that they didn't use
> scientific principals when they built their bridges.
In that case, we're in violent agreement.
tom
--
This is your life and it's ending one minute at a time.
== 5 of 15 ==
Date: Sat, Nov 29 2008 12:09 pm
From: Martin Gregorie
On Sat, 29 Nov 2008 11:47:55 -0500, LR wrote:
> Then please allow me to ask what an engineer should do if a client wants
> an analysis done on the resonant frequency of a bridge, but not any work
> done on wind loading,
>
If the client has asked for an analysis then presumably the bridge
already exists and the project is simply to measure what the client wants
measured or inspected.
If the bridge doesn't exist then its a design project. You'd have to
start by designing a structure that matches or exceeds the bridge
building regulations as well as taking proper account of the physical and
climactic conditions at its site. Doing anything else would give a
meaningless prediction since all these constraints will affect its
resonant frequencies.
Don't forget that all major civil engineering projects are one-off
structures: its very unlikely that anybody has previously built this type
of object on this spot using the specified materials and methods.
> would be, let's call it static deck loading, or transient deck loading.
>
I'm not a civil engineer, but deck loadings would be determined entirely
by traffic predictions and the bridge building regulations in force at
the site. These are design constraints rather that things to be analysed.
> Or another fluids problem bridges encounter, water on their supports.
> Can an engineer take that work?
>
Same considerations apply, except that an analysis of the effect of water
on the mid-stream supports is most likely to involve divers making an
inspection after the bridge has been in place long enough to have settled
down and for flow disturbances from the supports to have modified the
river bed.
--
== 6 of 15 ==
Date: Sat, Nov 29 2008 12:19 pm
From: James Kanze
On Nov 29, 5:41 pm, "Daniel T." <danie...@earthlink.net> wrote:
> James Kanze <james.ka...@gmail.com> wrote:
> > On Nov 29, 2:57 am, "Daniel T." <danie...@earthlink.net> wrote:
> > > I argue that C++/Java programmers do help design the application.
> > But doesn't this depend on the process. In most cases I've
> > seen, the software developers are responsible for many
> > aspects of low level design. But it's not a given; a
> > process could have a separate design team, which specified
> > everything in detail, to the point where the developers only
> > had to "pisser les lignes"; there responsibility wouldn't be
> > much more than that of a bricklayer.
> Many orginazations have attempted to relegate the programmer
> to "brick layer" status. The effort has been so phenomenally
> unsuccessful that there has been a backlash and now even
> attempts at reasonable high-level design are often met with
> derision.
It depends on what the application is. Someone writing a pay
program in Cobol isn't very far from the brick layer.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
== 7 of 15 ==
Date: Sat, Nov 29 2008 12:23 pm
From: James Kanze
On Nov 29, 7:45 pm, Lew <no...@lewscanon.com> wrote:
> Lew wrote:
> >> If you are speaking of the United States, one has the First
> >> Amendment right to call oneself whatever one likes.
> James Kanze wrote:
> > Where does it say that in the first amendment? I can't find it.
> "Congress shall make no law ... abridging the freedom of
> speech ..."
> It's not a very long amendment, and it's commonly referred to
> as "freedom of speech". Rather hard to miss.
Freedom of speech isn't absolute. Laws against false
advertising exist, and are applied. Laws against assuming a
false identity exist as well.
> Lew wrote:
> >> I can call myself President of the United States or God,
> >> should I so choose. (Since no one agrees on what or if God
> >> is, that last one has no conceivable actionable consequences
> >> at law.)
> James Kanze wrote:
> > I don't know about God, but you cannot enter into a contract
> > as the President of the United States; only one person has a
> > legal right to that title.
> Entering into a contract is a specific act that is not
> "calling oneself" a title. The First Amendment doesn't cover
> that.
As usual, you change the established meaning of words. "Calling
oneself" means "calling oneself". In a contract or elsewhere.
> James Kanze wrote:
> > Closer to home, you cannot open an office as a doctor unless
> > you have legally recognized qualifications.
> Again, that is action other than speech.
Again, you're trying to redefine "calling oneself".
> > What you call yourself in private circles probably won't
> > cause any problems, as long as no one decides to prosecute.
> It's not even actionable if they do.
That depends on how private the circles are.
> > If you present yourself publicly as an M.D. however, you'd
> > better have the corresponding qualifications, or you'll have
> > legal problems.
> Only if you engage in certain specific acts for which it's a
> requirement. Simple self-description isn't one of them.
Sorry, but telling someone in public you're a doctor when you
don't meet the legal qualifications is illegal.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
== 8 of 15 ==
Date: Sat, Nov 29 2008 12:29 pm
From: Martin Gregorie
On Sat, 29 Nov 2008 11:44:22 -0500, LR wrote:
>
> Evidently, there's an opinion that the arts can be more or less the
> same.
> http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/19900309/
REVIEWS/3090304/1023
>
> "Most movies are constructed out of bits and pieces of other movies,
> like little engines built from cinematic Erector sets."
>
Thats somewhat of a red herring. All a movie has to do is to be made to a
budget and to attract enough people to see it so the producers make a
profit on the project. Those are the only two constraints unless you also
want to specify that it doesn't get banned by the censors.
An engineering project of any type has to meet these too (cost, profit,
match or exceed regulatory requirements) but in addition it must match a
tight specification covering at a minimum its purpose, interfaces,
performance, scalability, usability and error recovery.
> Is there any reason in principle why C++ code can't run on a machine?
>
That's been done for Algol 68, so in theory you could write a C++
interpreter, but it would probably be complex and slow. Doing this
wouldn't sidestep any of the correctness issues posed by the compiler
and, indeed, would probably add some extras.
I don't think anybody could design and build hardware that could act
directly on a C++ source file (or any other language for that matter) but
in any case doing that would be hideously expensive and you'd end up with
hardware that could only run one particular version of one programming
language. You want Java or COBOL as well? Thats two more chunks of
hardware to be built from the ground up.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
== 9 of 15 ==
Date: Sat, Nov 29 2008 12:30 pm
From: Lew
James Kanze wrote:
> Sorry, but telling someone in public you're a doctor when you
> don't meet the legal qualifications is illegal.
I'm a doctor.
:-)
--
Lew
Doctor of love.
== 10 of 15 ==
Date: Sat, Nov 29 2008 12:33 pm
From: blmblm@myrealbox.com
In article <ggrost$fcp$1@localhost.localdomain>,
Martin Gregorie <martin@see.sig.for.address.invalid> wrote:
> On Sat, 29 Nov 2008 10:35:53 -0500, LR wrote:
>
> > Martin Gregorie wrote:
> >> On Fri, 28 Nov 2008 14:16:19 -0500, LR wrote:
[ snip ]
> BTW, Cheney should not have been rubbished for his "unknown unknowns":
Nitpick: Wasn't that Donald Rumsfeld, and the wording was slightly
different .... Or maybe they both said something along those lines.
> just because you don't know about something doesn't mean it isn't there,
> so a prudent course of action should make some allowance for that
> possibility.
--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.
== 11 of 15 ==
Date: Sat, Nov 29 2008 12:37 pm
From: courpron@gmail.com
On 29 nov, 20:11, Tom Anderson <t...@urchin.earth.li> wrote:
> On Sat, 29 Nov 2008, James Kanze wrote:
> > On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
> >> Kai-Uwe Bux wrote:
> >>> LR wrote:
> >>> a) There is some tension about where to put math.
>
> >> I didn't think so, but this thread has clarified that for me.
>
> >>> Some place it with the sciences, others don't.
>
> >> I don't.
>
> > So you're in a minority of one. All of the standard definitions
> > consider it science.
>
> Poppycock. No philosopher of science considers mathematics a science. The
> activities of mathematics and science are fundamentally different. Don't
> needlessly undermine your own argument by making statements like this.
Not quite.
Epistemology is precisely the area where the debate occurs. So you
can't say that *no* philosopher of science considers mathematics a
science.
Etymologically, mathematics and science both mean knowledge.
Science is originally just that : knowledge, and accessorily a method
to acquire that knowledge.
There's a debate because knowledge in maths is just abstract, doesn't
come from the real world.
However, AFAIK, most scientifics consider that mathematics are a
science, but that may be culturally biased.
> [...]
> > What physical phenomena are involved in such sciences as economic
> > science, or psychology, or sociology.
>
> In psychology, it's the array of physical and chemical processes which
> underly nerve activity. Neither economics nor sociology is a science.
In *psychiatry* yes.
In psychology, well not by default, although there is the neuro-
psychology branch that studies those effects.
Alexandre Courpron.
== 12 of 15 ==
Date: Sat, Nov 29 2008 12:38 pm
From: blmblm@myrealbox.com
In article <49316d1b$0$19155$cc2e38e6@news.uslec.net>,
LR <lruss@superlink.net> wrote:
> James Kanze wrote:
> > On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
[ snip ]
> It's less clear to me, perhaps because I don't know enough about them
> that psychology and sociology are sciences.
Is this where someone should mention the joke(?) about how anything
with "science" in its name isn't one ..... As I heard it, the
is-it-a-joke continues along these lines: "Think about it --
social science? political science? hm, computer science?"
Not taking sides in this argument, mostly lurking and observing
with interest.
[ snip ]
--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.
== 13 of 15 ==
Date: Sat, Nov 29 2008 12:41 pm
From: blmblm@myrealbox.com
In article <49305b9b$0$90271$14726298@news.sunsite.dk>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
[ snip ]
> >>> Yeah, that's it then. Except math is not a science.
> >> Sure is.
> >>
> >> It is a formal science and a basis for all the empirical
> >> sciences.
> >
> > Certainly not what I was taught in school.
>
> Possible.
>
> But did you ever notice what a master degree in math is called ?
>
Oh, I don't know that you can really go by that -- some schools
apparently offer a degree called "Bachelor of Science in Business
Administration". (But maybe I shouldn't be too snide -- perhaps
what's taught in business courses *is* a science in some way.
"Just sayin", maybe.)
--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.
== 14 of 15 ==
Date: Sat, Nov 29 2008 12:56 pm
From: Lew
blmblm@myrealbox.com wrote:
> In article <49305b9b$0$90271$14726298@news.sunsite.dk>,
> Arne Vajh�j <arne@vajhoej.dk> wrote:
>
> [ snip ]
>
>>>>> Yeah, that's it then. Except math is not a science.
>>>> Sure is.
>>>>
>>>> It is a formal science and a basis for all the empirical
>>>> sciences.
>>> Certainly not what I was taught in school.
>> Possible.
>>
>> But did you ever notice what a master degree in math is called ?
>>
>
> Oh, I don't know that you can really go by that -- some schools
> apparently offer a degree called "Bachelor of Science in Business
> Administration". (But maybe I shouldn't be too snide -- perhaps
> what's taught in business courses *is* a science in some way.
> "Just sayin", maybe.)
This entire thread is cognate to discussions of how many angels one can invite
to the Head-of-the-Pin Annual Ball before the heavenly fire marshal shuts it down.
--
Lew
== 15 of 15 ==
Date: Sat, Nov 29 2008 1:19 pm
From: Arne Vajhøj
blmblm@myrealbox.com wrote:
> In article <49305b9b$0$90271$14726298@news.sunsite.dk>,
> Arne Vajhøj <arne@vajhoej.dk> wrote:
>>>>> Yeah, that's it then. Except math is not a science.
>>>> Sure is.
>>>>
>>>> It is a formal science and a basis for all the empirical
>>>> sciences.
>>> Certainly not what I was taught in school.
>> Possible.
>>
>> But did you ever notice what a master degree in math is called ?
>>
>
> Oh, I don't know that you can really go by that -- some schools
> apparently offer a degree called "Bachelor of Science in Business
> Administration". (But maybe I shouldn't be too snide -- perhaps
> what's taught in business courses *is* a science in some way.
> "Just sayin", maybe.)
Business Administration is a science. Not a natural science
though. And not engineering either.
Arne
==============================================================================
TOPIC: The Java vs C++ higher salary thread
http://groups.google.com/group/comp.lang.c++/t/be2a8dac2cb503c3?hl=en
==============================================================================
== 1 of 3 ==
Date: Sat, Nov 29 2008 11:27 am
From: Zjargands
Can we, as a group, please stop posting to this thread? It has over 100
posts, many of them (most) unrelated to the original question or simply
restatements of what others have already said.
Many of the sub threads have devolved into arguments between 2 or three
people going back and forth with petty arguments that should be resolved
in private e-mail.
A good example would be the "what constitutes an engineer" sub thread.
This topic has nothing to do with c++.
Thank you for your constructive comments and consideration.
== 2 of 3 ==
Date: Sat, Nov 29 2008 11:32 am
From: Ian Collins
Zjargands wrote:
> Can we, as a group, please stop posting to this thread? It has over 100
> posts, many of them (most) unrelated to the original question or simply
> restatements of what others have already said.
>
> Many of the sub threads have devolved into arguments between 2 or three
> people going back and forth with petty arguments that should be resolved
> in private e-mail.
>
> A good example would be the "what constitutes an engineer" sub thread.
> This topic has nothing to do with c++.
>
> Thank you for your constructive comments and consideration.
>
Just kill the thread if you don't want to read it.
--
Ian Collins
== 3 of 3 ==
Date: Sat, Nov 29 2008 12:01 pm
From: Sherm Pendley
Ian Collins <ian-news@hotmail.com> writes:
> Just kill the thread if you don't want to read it.
Normally I would agree, but the references and cross-posts have gotten
so tangled that my news reader (gnus) can't figure them all out well
enough to do that. :-(
Please folks, take it to email. Or just let it rest already - you've
each made your points about a dozen times now, and it's obvious to any
sane person that another dozen repetitions isn't going to change
anyone's minds.
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
==============================================================================
TOPIC: Object pointer casted to int* , wont increment with ++
http://groups.google.com/group/comp.lang.c++/t/56fc5b72c8602df0?hl=en
==============================================================================
== 1 of 4 ==
Date: Sat, Nov 29 2008 11:40 am
From: Ravi
I was playing with object pointers here:
http://pastebin.com/f6bb9d1a0
If I change line 46 to:
double *pd = (double *)((int *)px1++);
The pointer doesn't increment as shown by the output at stdout.
== 2 of 4 ==
Date: Sat, Nov 29 2008 11:55 am
From: Kai-Uwe Bux
Ravi wrote:
> I was playing with object pointers here:
> http://pastebin.com/f6bb9d1a0
>
> If I change line 46 to:
>
> double *pd = (double *)((int *)px1++);
>
> The pointer doesn't increment as shown by the output at stdout.
You have undefined behavior all over the place: dereferencing or
incrementing a pointer casted to a type that is not the type of the
underlying object is undefined behavior.
Best
Kai-Uwe Bux
== 3 of 4 ==
Date: Sat, Nov 29 2008 12:54 pm
From: "julien.hamaide@gmail.com"
On Nov 29, 8:40 pm, Ravi <ra.ravi....@gmail.com> wrote:
> I was playing with object pointers here:http://pastebin.com/f6bb9d1a0
>
> If I change line 46 to:
>
> double *pd = (double *)((int *)px1++);
>
> The pointer doesn't increment as shown by the output at stdout.
Even if it's full of undefined behavior, (int*)px1++ execute first px1+
+ then (int*),
try to scope the cast ( (int*)px1 )++
== 4 of 4 ==
Date: Sat, Nov 29 2008 12:57 pm
From: Andrey Tarasevich
Ravi wrote:
> I was playing with object pointers here:
> http://pastebin.com/f6bb9d1a0
>
> If I change line 46 to:
>
> double *pd = (double *)((int *)px1++);
>
> The pointer doesn't increment as shown by the output at stdout.
Doesn't increment? Sorry, but that doesn't make any sense. Nowhere in
your code after line 46 I see anything that would demonstrate whether
the pointer got incremented or not. You don't output the new value of
'px1', you don't output anything that depends on the new value of 'px1'.
What made you conclude that it doesn't increment then?
--
Best regards,
Andrey Tarasevich
==============================================================================
TOPIC: binary format of the number.
http://groups.google.com/group/comp.lang.c++/t/bf11dd6e68624537?hl=en
==============================================================================
== 1 of 2 ==
Date: Sat, Nov 29 2008 11:46 am
From: James Kanze
On Nov 29, 4:53 pm, Gennaro Prota <gennaro/pr...@yahoo.com> wrote:
> James Kanze wrote:
> > I suspect that the main reason C++ doesn't support binary
> > literals is because C doesn't, and the main reason C doesn't
> > is because no one has proposed them to the committee.
> They were proposed for C++, as early as in 1993, together with
> other lexical-related improvements (n0259). I don't know why
> they were rejected,
Probably because it's not in C. Pretty much everything
regarding integral types is the responsibility of C, and C++
just adopts whatever C decides. (At least, that's the way it
should be.)
> but the general committee attitude seems to be way less
> conservative now: in fact, the current draft allows defining a
> "literal operator" (which is not an operator; very bad
> naming), such as:
> unsigned long operator "" b( char const * ) ;
> or a "literal operator template":
> template< class ... Types >
> unsigned long operator "" b() ;
> and have whichever of them you define called for literals with
> the b suffix:
> 11000111b
This has to be a joke, right.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
== 2 of 2 ==
Date: Sat, Nov 29 2008 1:25 pm
From: George Kettleborough
On 28/11/08 09:19, Tarmo Kuuse wrote:
> Bill wrote:
>> Why would you prefer to write down strings of 0s and 1s anyway? Seems like
>> it would increase your chance of error. If you really wanted to, you could
>> write your own function which translates binary character strings to an
>> integral data type. For instance, int binary2Int(const char *).
>
> When working at low level (embedded, device drivers, ...), bit fields
> are scattered throughout code. It is quite annoying to convert binary to
> hexadecimal and vice versa for 32-bit values.
>
> Let's see now, is bit 22 set in mask 0x03C00000? OK, give me a minute...
For bit fields wouldn't it be a lot easier to use vector<bool>?
--
George Kettleborough
==============================================================================
TOPIC: Template copy constructor question.
http://groups.google.com/group/comp.lang.c++/t/3e7e58e58810584a?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Nov 29 2008 1:03 pm
From: Andrey Tarasevich
ravajappa.gouda@gmail.com wrote:
> Can somebody tell me when does copy constructor 1 or 2 gets called
> in a template class below?
This question is already incorrect by itself. There's only one copy
constructor in your class. It is constructor 2. Template 1 does not
define any copy constructors. It can be used to generate _conversion_
constructors, but not copy constructors.
> And if you can explain the difference
> between the 1 and 2 below would be great?
I don't really see what needs to be explained here. These constructors
take arguments of different types. So the right one will be chosen
depending on the type of the argument used during construction. That's
basically it.
> template<typename T, size_t size>
> class container {
>
> public:
> container() //default constructor.
> {
> }
>
> template<typename cT, size_t cs> // Copy
> constructor 1
> container(const container<cT, cs>& rhs)
> {
> ........
> }
>
> container(const container& rhs) // Copy
> constructor 2
> {
> ..........
> }
>
>
> private: ..... //
> private members defined here.
> };
--
Best regards,
Andrey Tarasevich
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en
To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
No comments:
Post a Comment