http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* Speed of C++ compared with speed of other languages - 6 messages, 4 authors
http://groups.google.com/group/comp.lang.c++/t/786cfdf0ab25866d?hl=en
* comparing numeric literals (was: Defining a subset of C++) - 8 messages, 5
authors
http://groups.google.com/group/comp.lang.c++/t/6718a9cd2f3ecdbf?hl=en
* compilation error with default argument - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/482543c071bd94fa?hl=en
* ♬+♬+♬wholesale cheap brands handbags and purse by paypal in www.ecyaya.com -
1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/3a9dc2f8780ba544?hl=en
* ❤◆❤◆❤ <Free Shipping> 2009 Cheap wholesale Converse shoes at www.fjrjtrade.
com <Paypal Payment> - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/9bfce5ab67a22c70?hl=en
* test - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/cdc415b72c5a2a77?hl=en
* Free shipping Cheap Nike Air Max 87, Max 180, Max LTD, Max TN, Shox NZ, Air
Force One,Dunk SB (www.vipchinatrade.com) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/e6254a2cea2f051b?hl=en
* Different types of cast - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/b5b881bc79379355?hl=en
* String not printing data on next line despite \n in the string - 1 messages,
1 author
http://groups.google.com/group/comp.lang.c++/t/35658d761ffe5130?hl=en
* Writing good articles that have much better chance to be seen by others - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/ddbe20a354342370?hl=en
* different ways of allocating memory - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/cae68a10a2667fb5?hl=en
==============================================================================
TOPIC: Speed of C++ compared with speed of other languages
http://groups.google.com/group/comp.lang.c++/t/786cfdf0ab25866d?hl=en
==============================================================================
== 1 of 6 ==
Date: Thurs, Dec 24 2009 6:52 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
"Balog Pal" <pasa@lib.hu> writes:
>Can you provide an application example where that java's
>allegedly superfast allocation can be noticed?
BTW: The benchmarks I have referred to should have measured
the execution time already /including/ possible GC runs.
So, when they find Java to be nearly as fast as C++,
this already includes the allocation and possibly GC times.
And regarding your question: If the allocation in Java would
take more time than it takes now, those benchmarks would
obviously have found Java to be slower. So the time Java
needs for an allocation can be noticed in nearly every Java
program as a part of the overall performance, since most
Java programs do many allocations.
== 2 of 6 ==
Date: Thurs, Dec 24 2009 10:14 am
From: Branimir Maksimovic
Kaz Kylheku wrote:
> GC is very efficient from an SMP point of view, because it allows
> for immutable objects to be truly immutable, over most of their
> lifetime.
SMP means nothing in comparison of performance gain you get
from CPU cache.
Immutable objects are really bad idea, for example all objects
in haskell are immutable. Array update is O(n) string
is implemented as linked list. That's why no one really uses
haskell deafult objects, rather we have fast mutable string fast m
utable array fast mutable this and that etc which are
actually structures implemented in c.
And no one actually programs function stile rather
payload code is wrapped in monads ;)
Object copy is expensive operation in nowadays hardware.
It is always much faster and chipper to perform update
or use copy on write and reference counted strings....
because they are cache friendly. Mutex lock/unlock is very cheap
operation.
Look, I tested quad xeon against home athlon dual core.
Initializing 256 meg of ram from 4 threads (each thread 64meg)
on quad xeon on higher cpu frequency against old dual athlon , athlon
performs better or same! Catch 22 is that I tried fastest athlon
and got same result as old athlon;) because the have same
speed of memory bus ;)
On intels before i7 architecture secret of performance
was not to miss cache much....
Greets
== 3 of 6 ==
Date: Thurs, Dec 24 2009 11:25 am
From: tanix@mongo.net (tanix)
In article <Java-performance-20091224141824@ram.dialup.fu-berlin.de>, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>Branimir Maksimovic <bmaxa@hotmail.com> writes:
>>Refcounts are negligible in comparison to what gc is doing.
>>GC cannot be efficient since it cannot access program
>
> »[A]llocation in modern JVMs is far faster than the best
> performing malloc implementations. The common code path
> for new Object() in HotSpot 1.4.2 and later is
> approximately 10 machine instructions (data provided by
> Sun; see Resources), whereas the best performing malloc
> implementations in C require on average between 60 and 100
> instructions per call (Detlefs, et. al.; see Resources).
> And allocation performance is not a trivial component of
> overall performance -- benchmarks show that many
> real-world C and C++ programs, such as Perl and
> Ghostscript, spend 20 to 30 percent of their total
> execution time in malloc and free -- far more than the
> allocation and garbage collection overhead of a healthy
> Java application (Zorn; see Resources).«
>
>http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-jw22J
>avaUrbanLegends
Good read.
>>I don;t want to discuss this, but it is obvious that nothing in java is
>>designed with performance in mind. Quite opposite....
This is just an insult and not only an insult to intelligence
of those, who designed the language, but total fiction.
> Java 1.6 (aka »Java 6«) is already one of the fastest languages:
>http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
Yep, that is what I suspected.
> And Java 1.7 (aka »Java 7«) is reported to be even faster:
>
> »Java 5 <=== 18% faster=== < Java 6 < ===46% faster===< Java 7«
>
>http://www.taranfx.com/blog/java-7-whats-new-performance-benchmark-1-5-1-6-1-7
Cool. I like that. Helps me quite a bit.
> See also:
>
>http://www.stefankrause.net/wp/?p=9
>
>http://paulbuchheit.blogspot.com/2007/06/java-is-faster-than-c.html
>
>http://www.idiom.com/~zilla/Computer/javaCbenchmark.html
--
Programmer's Goldmine collections:
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.
== 4 of 6 ==
Date: Thurs, Dec 24 2009 11:37 am
From: Branimir Maksimovic
tanix wrote:
> In article <Java-performance-20091224141824@ram.dialup.fu-berlin.de>, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>> Branimir Maksimovic <bmaxa@hotmail.com> writes:
>
>>> I don;t want to discuss this, but it is obvious that nothing in java is
>>> designed with performance in mind. Quite opposite....
>
> This is just an insult and not only an insult to intelligence
> of those, who designed the language, but total fiction.
Yeh, right Im reading local os news groups and sysadmins always
ask how to tweak vm to perform faster...
Lot of complains about java software and performance on high
end hardware and SAN.....
>
>> Java 1.6 (aka »Java 6«) is already one of the fastest languages:
>
>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>
> Yep, that is what I suspected.
Yeah, that site is really good reference for language benchmarks ;)
Why don;t they test application with more then 100 lines of code ;)
Greets...
== 5 of 6 ==
Date: Thurs, Dec 24 2009 12:07 pm
From: tanix@mongo.net (tanix)
In article <hh0fth$mmc$1@news.albasani.net>, Branimir Maksimovic <bmaxa@hotmail.com> wrote:
>tanix wrote:
>> In article <Java-performance-20091224141824@ram.dialup.fu-berlin.de>,
> ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>>> Branimir Maksimovic <bmaxa@hotmail.com> writes:
>>
>>>> I don;t want to discuss this, but it is obvious that nothing in java is
>>>> designed with performance in mind. Quite opposite....
>>
>> This is just an insult and not only an insult to intelligence
>> of those, who designed the language, but total fiction.
>
>Yeh, right Im reading local os news groups and sysadmins always
>ask how to tweak vm to perform faster...
Does not mean anything to me.
Some people are obscessed beyond reason.
>Lot of complains about java software and performance on high
>end hardware and SAN.....
>
>>
>>> Java 1.6 (aka »Java 6«) is already one of the fastest languages:
>>
>>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>
>> Yep, that is what I suspected.
>
>Yeah, that site is really good reference for language benchmarks ;)
>Why don;t they test application with more then 100 lines of code ;)
>
>Greets...
>
--
Programmer's Goldmine collections:
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.
== 6 of 6 ==
Date: Thurs, Dec 24 2009 3:38 pm
From: Sam
Stefan Ram writes:
> Branimir Maksimovic <bmaxa@hotmail.com> writes:
>>Refcounts are negligible in comparison to what gc is doing.
>>GC cannot be efficient since it cannot access program
>
> »[A]llocation in modern JVMs is far faster than the best
> performing malloc implementations. The common code path
> for new Object() in HotSpot 1.4.2 and later is
> approximately 10 machine instructions (data provided by
> Sun; see Resources), whereas the best performing malloc
> implementations in C require on average between 60 and 100
> instructions per call (Detlefs, et. al.; see Resources).
> And allocation performance is not a trivial component of
> overall performance -- benchmarks show that many
> real-world C and C++ programs, such as Perl and
> Ghostscript, spend 20 to 30 percent of their total
> execution time in malloc and free -- far more than the
> allocation and garbage collection overhead of a healthy
> Java application (Zorn; see Resources).«
>
> http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-jw22JavaUrbanLegends
What this kind of a bogus metric assumes is a direct 1:1 mapping between
heap allocation in Java, and heap allocation in C++.
This is an absurd comparison. In Java, everything gets allocated on the
heap. This is not true for C++, where quite a bit of stuff gets allocated on
the stack. In most cases, this requires exactly 0 machine instructions,
above the usual stack frame setup for a function call. In the worst case,
where an aggressive compiler minimizes stack usage by recycling stack space
for objects in non-overlapping scopes, 1 machine instruction per allocation
would be expended.
But in in Java, a lot more stuff gets allocated on the heap. Every string
literal constructs a java.lang.String object, for example:
write(1, "Foo\n", 4);
This results in no heap allocation in C++.
Even the C++-y way:
std::cout << "Foo" << std::endl;
That's still does not compile into any heap allocations, per se. Some might
occur as a result of invoking the appropriate methods of
std::ostream::operator<<, but the same would apply to internal
implementation of Java's println:
System.out.println("Foo");
But even before println gets invoked, it takes a java.lang.String as a
parameter. The literal string results in a java.lang.String getting
constructed on the heap, even before println() gets invoked (and it gets
garbage-collected at some future time).
I suppose that a very aggressive JVM may compile this down to JIT code and
furnish a special-case implementation for this type of a call to println()
that avoids a heap allocation. I don't know if any JVMs actually do that,
but I would be very surprised. Since all methods in java are virtual, this
severely limits the assumptions one could make for println() for some
arbitrary object that implements the Writer interface.
So, measuring the raw performance of Java's heap allocator directly against
some C++'s allocator is a meaningless comparison, since a typical Java
application would be hammering on the heap far more than an equivalent C++
application. But, having said that, it would certainly not hurt for common
C/C++ library implementations of heap allocations to borrow some tricks from
Java's. Some of the stuff it does would certainly work for C++ too.
==============================================================================
TOPIC: comparing numeric literals (was: Defining a subset of C++)
http://groups.google.com/group/comp.lang.c++/t/6718a9cd2f3ecdbf?hl=en
==============================================================================
== 1 of 8 ==
Date: Thurs, Dec 24 2009 6:57 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
"Balog Pal" <pasa@lib.hu> writes:
>>For example, one might try to use/teach »int« only
>>(not »unsinged«, »short«, or »long«), but then,
>>how does one explain the value and/or behavior of
>>an evaluation of »-1 < 3000000000«?
>What you explain in this behavior?
I do not understand the wording of this question.
Maybe someone could rephrase it?
== 2 of 8 ==
Date: Thurs, Dec 24 2009 7:28 am
From: "Balog Pal"
"Stefan Ram" <ram@zedat.fu-berlin.de>
> "Balog Pal" <pasa@lib.hu> writes:
>>>For example, one might try to use/teach »int« only
>>>(not »unsinged«, »short«, or »long«), but then,
>>>how does one explain the value and/or behavior of
>>>an evaluation of »-1 < 3000000000«?
>>What you explain in this behavior?
>
> I do not understand the wording of this question.
> Maybe someone could rephrase it?
Ok, let's start in little. Please explain the behavior if you don't have any
artificial restrictions, and mark the place where the explanation would be a
problem with restrictions.
== 3 of 8 ==
Date: Thurs, Dec 24 2009 9:08 am
From: Jon Harrop
red floyd wrote:
> On Dec 23, 12:50 pm, Jon Harrop <j...@ffconsultancy.com> wrote:
>> The number of job adverts in the UK citing C++ has fallen 40% for the
>> second year in a row:
>>
>
> Hey, Jon! Wha'ts the market for F# jobs like?
Extrapolating the current trends, there will be more F# jobs than C++ jobs
in 2012:
http://fsharpnews.blogspot.com/2009/12/trending-f-jobs-in-uk.html
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
== 4 of 8 ==
Date: Thurs, Dec 24 2009 10:50 am
From: tanix@mongo.net (tanix)
In article <C++-directions-20091224135126@ram.dialup.fu-berlin.de>, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>Christof Warlich <cwarlich@gmx.de> writes:
>>giving decent directions to the average library user
>
> Maybe these directions would be as follows?
>
> »an interesting difference between "Effective Java" and
> "Effective C++" is that my reaction to the latter was to
> come up with a set of SOPs that mainly boil down to
> "don't use C++ feature x".«
> ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
> Bjorn Borud
If I recall correctly, "Effective Java" is a MUNUMENTAL work.
><m3is1ti9kq.fsf@borud.not>
>
> However, the idea of defining a subset of C++ has at least
> two problems:
>
> - One can not really isolate a subset from the
> rest of the language, at many places the rest
> of the language leaks in.
>
> For example, one might try to use/teach »int« only
> (not »unsinged«, »short«, or »long«), but then,
> how does one explain the value and/or behavior of
> an evaluation of »-1 < 3000000000«?
>
> - This idea is also based on the assumption that
> C++ programs are written. They are not. At least
> most of the time. Source code is more often /read/
> then written (in order to maintain/modify/reuse
> code - programs are modified more often than written
> from scratch).
Yep. And that is exactly what most people forget, or do not
even realize, thinking that by writing as "advanced" code,
as they can come up with, is that this is all about.
Because READING that "sophisticated" code will take 10 times
longer, if you EVER will be able to see all the subtleties
of it.
> So, when I have learned only a subset
> of a language, it might not allow me to read many
> programs.
--
Programmer's Goldmine collections:
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.
== 5 of 8 ==
Date: Thurs, Dec 24 2009 12:58 pm
From: ram@zedat.fu-berlin.de (Stefan Ram)
"Balog Pal" <pasa@lib.hu> writes:
>>>>an evaluation of »-1 < 3000000000«?
>Please explain the behavior if you don't have any artificial
>restrictions, and mark the place where the explanation would
>be a problem with restrictions.
I do not understand the part with »restrictions«,
but I'll just explain the behavior:
I have no prepared answer, so I'll try to find one now ...
In standards I find:
»If it is decimal and has no suffix, it has the first of
these types in which its value can be represented: int,
long int; if the value cannot be represented as a long
int, the behavior is undefined.«
»climits ... LONG_MAX«
»maximum value for an object of type long int LONG_MAX
+2147483647«
Thus, if 3000000000 cannot be represented as a long int, the
behavior is undefined (for example, I know one implementation
yielding the value 0), otherwise, the value is 1.
== 6 of 8 ==
Date: Thurs, Dec 24 2009 1:19 pm
From: "Balog Pal"
"Stefan Ram" <ram@zedat.fu-berlin.de>
>>>>>an evaluation of »-1 < 3000000000«?
> Thus, if 3000000000 cannot be represented as a long int, the
> behavior is undefined (for example, I know one implementation
> yielding the value 0), otherwise, the value is 1.
Exactly, the so if 3G can be represented the expression is always true,
otherwise UB. This is the case regardless your guidelines would say not to
use short, long, unsigned.
So your original problem around the "how you explain" is still as moot as
originally, care to elaborate?
== 7 of 8 ==
Date: Thurs, Dec 24 2009 2:54 pm
From: Marcelo De Brito
Hi!
Guys, I think you should immediately read this:
http://www.stsc.hill.af.mil/CrossTalk/2008/01/0801DewarSchonberg.html
Best regards!
Marcelo
== 8 of 8 ==
Date: Thurs, Dec 24 2009 3:07 pm
From: ram@zedat.fu-berlin.de (Stefan Ram)
"Balog Pal" <pasa@lib.hu> writes:
>So your original problem around the "how you explain" is still as moot as
>originally, care to elaborate?
My original assumption was that one can not easily restrict
the set of integer types to »int«. A student might observe,
for example, that under his C++ implementation,
»-1 < 3000000000« yields 0 and ask for an explanation.
To correctly explain this, one might need to mention »long«
and possibly also »unsigned long« (in the case of this C++
implementation).
==============================================================================
TOPIC: compilation error with default argument
http://groups.google.com/group/comp.lang.c++/t/482543c071bd94fa?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Dec 24 2009 7:06 am
From: "subramanian100in@yahoo.com, India"
This question is for learning purpose only.
Consider the program x.cpp:
#include <cstdlib>
using namespace std;
void fn(int x = 7);
void fn(int = 7);
int main()
{
return EXIT_SUCCESS;
}
When I compiled this program with g++3.4.3 as
g++ -std=c++98 -pedantic -Wall -Wextra x.cpp,
I get the following compilation error:
x.cpp:6: error: default argument given for parameter 1 of `void fn
(int)'
x.cpp:5: error: after previous specification in `void fn(int)'
But Stroustrup in his book "The C++ Programming Language - Third
Edition(NOT the Special Third Edition)" has mentioned the following in
page 153 in section "7.5 Default Arguments":
A default argument can be repeated in a susequent declaration in the
same scope but not changed. Having this being stated, I do not
understand why the compiler is giving error. Have I misunderstood what
Sttroustrup has stated ? Kindly clarify.
Thanks
V.Subramanian
== 2 of 2 ==
Date: Thurs, Dec 24 2009 7:36 am
From: "Balog Pal"
> void fn(int x = 7);
> void fn(int = 7);
> When I compiled this program with g++3.4.3 as
> g++ -std=c++98 -pedantic -Wall -Wextra x.cpp,
> I get the following compilation error:
>
> x.cpp:6: error: default argument given for parameter 1 of `void fn
> (int)'
> x.cpp:5: error: after previous specification in `void fn(int)'
>
> But Stroustrup in his book "The C++ Programming Language - Third
> Edition(NOT the Special Third Edition)" has mentioned the following in
> page 153 in section "7.5 Default Arguments":
> A default argument can be repeated in a susequent declaration in the
> same scope but not changed. Having this being stated, I do not
> understand why the compiler is giving error. Have I misunderstood what
> Sttroustrup has stated ? Kindly clarify.
Dunno what BS meant, the standard doesn't allow redefining the same default
param even to the same value (see example in 3.8.6p4 last words). Though
you can make further params default.
quote 3.8.6p4:
For nontemplate functions, default arguments can be added in later
declarations of a function in the same scope. Declarations in different
scopes have completely distinct sets of default arguments. That is,
declarations in inner scopes do not acquire default arguments from
declarations in outer scopes, and vice versa. In a given function
declaration, all parameters subsequent to a parameter with a default
argument shall have default arguments supplied in this or previous
declarations. A default argument shall not be redefined by a later
declaration (not even to the same value).
==============================================================================
TOPIC: ♬+♬+♬wholesale cheap brands handbags and purse by paypal in www.ecyaya.
com
http://groups.google.com/group/comp.lang.c++/t/3a9dc2f8780ba544?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 7:25 am
From: hero
♬+♬+♬wholesale cheap brands handbags and purse by paypal in www.ecyaya.com
wholesale cheap Balenciaga Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap Burberry Handbags or purse (www.ecyaya.com)
wholesale cheap Chanel Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap Chloe Handbags or purse
wholesale cheap Christian Audigier Handbags or purse (www.ecyaya.com)
wholesale cheap Coach Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap D&G Handbags or purse (www.ecyaya.com)
wholesale cheap Dooney&Bourke Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap ED Hardy Handbags or purse (www.ecyaya.com)
wholesale cheap Fendi Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap Gucci Handbags or purse (www.ecyaya.com)
wholesale cheap GUSS Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap Hermas Handbags or purse (www.ecyaya.com)
wholesale cheap JIMMY CHOO Handbags or purse (www.ecyaya.com) (free
shipping)
wholesale cheap Juicy Handbags or purse (www.ecyaya.com)
wholesale cheap LV Handbags or purse (www.ecyaya.com) (free shipping)
wholesale cheap Miu Miu Handbags or purse (www.ecyaya.com)
wholesale cheap Prada Handbags or purse (www.ecyaya.com) (free
shipping)
vcheap Versace Handbags or purse (www.ecyaya.com)
wholesale cheap AAA BAG Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA Chanel Purse in www.ecyaya.com
wholesale cheap AAA Dior Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA LV Handbags in www.ecyaya.com
wholesale cheap AAA Balenciaga Handbags in www.ecyaya.com(free
shipping)
wholesale cheap AAA Chloe Handbags in www.ecyaya.com
wholesale cheap AAA Giorgio Armani Purse in www.ecyaya.com
(free shipping)
wholesale cheap AAA LV Purse in www.ecyaya.com
wholesale cheap AAA Balenciaga Purse in www.ecyaya.com(free shipping)
wholesale cheap AAA Chloe Purse in www.ecyaya.com
wholesale cheap AAA Gucci Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA Bally Purse in www.ecyaya.com
wholesale cheap AAA Coach Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA Hermes Purse in www.ecyaya.com
wholesale cheap AAA Boss Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA Coach Purse in www.ecyaya.com
wholesale cheap AAA JIMMY CHOO Handbags in www.ecyaya.com
wholesale cheap AAA Chanel Handbags in www.ecyaya.com(free shipping)
wholesale cheap AAA D&G Purse in www.ecyaya.com
wholesale cheap AAA JIMMY CHOO Purse in www.ecyaya.com(free shipping)
==============================================================================
TOPIC: ❤◆❤◆❤ <Free Shipping> 2009 Cheap wholesale Converse shoes at www.
fjrjtrade.com <Paypal Payment>
http://groups.google.com/group/comp.lang.c++/t/9bfce5ab67a22c70?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 8:13 am
From: "www.fjrjtrade.com"
❤◆❤◆❤ <Free Shipping> 2009 Cheap wholesale Converse shoes at www.fjrjtrade.com
<Paypal Payment>
Welcome to visit www.fjrjtrade.com
cheap wholesale brand shoes www.fjrjtrade.com
cheap wholesale shoes www.fjrjtrade.com
cheap wholesale shoes www.fjrjtrade.com
Men size 40,41,42,43,44,45,46. Women size 36,37,38,39,40.
High quality wholesale Air Force One shoes, Nike Jordan, Nike,Air Max,
Nike Shox, UGG Shoes, Puma Shoes, Nike shoes, Adidas Shoes, Christian
Louboutin, Chanel Shoes, Coach Shoes, D&G Shoes, Dior Shoes, ED Hardy
Shoes, Evisu Shoes, Fendi Shoes, AFF shoes, Bape shoes, Gucci Shoes,
Hogan shoes, Bikkembergs Shoes, Dsquared Shoes, LV Shoes, Timberland
Shoes, Boss shoes, Versace Shoes, Prada Shoes, Lacoste Shoes, Mauri
Shoes, DC shoes ect. Details at website www.fjrjtrade.com
Cheap Wholesale Converse Shoes
http://www.fjrjtrade.com/928-Converse-Shoes.html
Cheap Wholesale Converse Man Shoes
http://www.fjrjtrade.com/980-Converse-Man-Shoes.html
Cheap Wholesale Converse Women Shoes
http://www.fjrjtrade.com/981-Converse-Women-Shoes.html
Cheap Wholesale Converse M&W
http://www.fjrjtrade.com/2046-Converse-MW.html
Cheap Wholesale Converse W&M High
http://www.fjrjtrade.com/2047-Converse-WM-High.html
Website:
http://www.fjrjtrade.com
==============================================================================
TOPIC: test
http://groups.google.com/group/comp.lang.c++/t/cdc415b72c5a2a77?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 8:29 am
From: red floyd
On Dec 23, 10:17 pm, yqever <yqe...@163.com> wrote:
> test
You failed the test. Try alt.test instead.
==============================================================================
TOPIC: Free shipping Cheap Nike Air Max 87, Max 180, Max LTD, Max TN, Shox NZ,
Air Force One,Dunk SB (www.vipchinatrade.com)
http://groups.google.com/group/comp.lang.c++/t/e6254a2cea2f051b?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 8:30 am
From: yoyo
Nike Air Max
Cheap Wholesale Nike Air Max 87 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 89 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 90 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 91 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 92 Man <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 93 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 95 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 97 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 180 Man <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 2006 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max 2009 <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max Clssic BW <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max LTD <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max Skyline <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max STAB <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max Tailwind <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Nike Air Max TN <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Shox NZ <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox OZ <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox R2 <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox R3 <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox R3+R4 <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox R4 <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox R5 <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox Reverie lover
Cheap Wholesale Shox RZ <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox TL <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox Torch <www.vipchinatrade.com> paypal payment
Cheap Wholesale Shox TZ <www.vipchinatrade.com> paypal payment
Air Force one <www.vipchinatrade.com> paypal payment
Cheap Wholesale Air Force One Man <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force One Women <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force One M&W <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force one 25 Man <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force One 25 Women <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force One Kid <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force one Mid Man <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force one Mid Women <www.vipchinatrade.com> paypal
payment
Cheap Wholesale Air Force one Hight Women <www.vipchinatrade.com>
paypal payment
Cheap Wholesale Nike shoes <www.vipchinatrade.com> paypal payment
Cheap Wholesale Nike Dunk SB <www.vipchinatrade.com> paypal payment
Cheap Wholesale Nike RLFT <www.vipchinatrade.com> paypal payment
==============================================================================
TOPIC: Different types of cast
http://groups.google.com/group/comp.lang.c++/t/b5b881bc79379355?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Dec 24 2009 8:39 am
From: "Johannes Schaub (litb)"
Ian Collins wrote:
> Tomislav Novak wrote:
>> On 2009-12-24, Christof Warlich <cwarlich@gmx.de> wrote:
>>> Ravi wrote:
>>>> What is the difference between static cast and reinterpret cast?
>>> With static_cast you may only cast within the same inheritance
>>> hierarchy, i.e. it is more restrictive and thus somewhat safer.
>>
>> static_cast also enables one to convert between types with implicit or
>> explicit conversion operators.
>>
>>> dynamic_cast is similar, adding run-time checking and making the cast
>>> really safe.
>>>
>>> reinterpret_cast allows any cast.
>>
>> Of course, it works for pointer types only (just to clarify further).
>
> No, it works for any type with the same size. But it can't be used to
> cast away const or volatile.
>
No, you are wrong. reinterpret_cast only allows very limited casts, like
every other c++ cast does. It does, in particular allow not to do
reinterpret_cast<unsigned char>('a'); // same size, eh?
And it does not allow casting to void* from another pointer, or from void*
to another pointer. It's just what its name is: It *reinterprets* pointer
representations to integers, and object/member pointers among themselves.
It also allows reinrerpreting arbitrary objects (disregarding their size) by
using references: "reinterpret_cast<unsigned char&>(some_int)" is perfectly
valid.
== 2 of 2 ==
Date: Thurs, Dec 24 2009 9:43 am
From: Stuart Golodetz
On 24/12/2009 06:48, Christof Warlich wrote:
> Ravi wrote:
>> What is the difference between static cast and reinterpret cast?
>
> With static_cast you may only cast within the same inheritance
> hierarchy, i.e. it is more restrictive and thus somewhat safer.
>
> dynamic_cast is similar, adding run-time checking and making the cast
> really safe.
It's not as simple as that (you shouldn't replace a dynamic_cast by a
static_cast and expect it to work if you're using virtual inheritance).
In particular, see FAQ 25.13 (brief though it is).
I actually asked about this a few years back and got a good answer from
Janusz Szpilewski which I'll reproduce here:
"Internal implementation of classes having virtual base classes is quite
complex. Usually such a virtual base is referenced by a pointer and it
may happen that such a base part is not even contiguous in the memory
with the derived object part.
Hence to make a correct cast to a class with virtual base classes some
runtime information about the actual (dynamic) type of the object being
casted may be required. Only dynamic_cast offers a possibility of
consulting the dynamic object type."
In my case I was asking for (what I would now describe as dubious)
performance-related reasons - in which case the key thing to bear in
mind is that you should be avoiding casting as much as possible anyway,
so there shouldn't be enough casting happening for performance to be an
issue in the first place.
Regards,
Stu
> reinterpret_cast allows any cast.
==============================================================================
TOPIC: String not printing data on next line despite \n in the string
http://groups.google.com/group/comp.lang.c++/t/35658d761ffe5130?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 10:40 am
From: Paavo Helde
SRK <kumarsr@gmail.com> wrote in news:f45f3f70-d140-4b48-af0a-
10f52eee8394@15g2000prz.googlegroups.com:
> Hi folks,
> I am trying to read some data from a config file and want that data to
> be printed in formatted way foe example if I have this string in the
> config file - ABC PQR XYZ and want to display it like
>
> ABC
> PQR
> XYZ
>
> for that I have put the above mentioned string as ABC \nPQR \nXYZ
>
> But instead of displaying the next string on next line, when I print
> the data, it prints as ABC \nPQR \nXYZ.
You need to convert two symbols (backslash and n) to a single symbol
(line-feed '\n').
If this is not very performance-critical, you can do it in-place:
std::string s = "ABC\\nPQR\\nXYZ\\n"; // contains backslash and n
std::string::size_type k = 0;
while((k=s.find("\\n", k))!=s.npos) {
s.replace(k, 2, "\n");
}
// s now contains linefeed characters instead.
hth
Paavo
==============================================================================
TOPIC: Writing good articles that have much better chance to be seen by others
http://groups.google.com/group/comp.lang.c++/t/ddbe20a354342370?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 12:05 pm
From: tanix@mongo.net (tanix)
People may not realize that majority of article reads
come from search engines and not directly reading the
Usenet.
First of all, to find some information for some specific
issue you may be dealing with is pretty much a hopeless
excersize if you just read Usenet or some disorganized
archive.
It may take you days or even months to step though all sorts
of threads reading it all sequentially, without any kind
of filtering offered by search engines.
When people need to resolve some issue, the first thing
they do is to perform a search engine search on the buzzwords
they think are significant.
So, when they click on some link in the SERPS, they only see
one article. They can not even follow your thread unless they
are willing to spend minutes of their time, the chances of
which are slim as it gets.
So, from this standpoint, try to keep the context of the article
intact. No not delete some section of the article you are following
upon because you think it is "insignificant" in YOUR opinion.
Because it may turn out to be significant in readers opinion.
Note on writing style:
Many people do not realize their articles become available
worldwide on many different sites, servers, search engines
and libraries and will stay there forever.
When they write something, they may not even consider
that it is better to take your time and describe some
topic completely so it becomes a reference material
to be used for generations to come.
Instead, they write cryptic articles that, when viewed
by themselves, may not even make much sense to someone,
who is not reading it on Usenet by following a thread
or as competent as the writer is.
Some people strip most of the article they followup on,
and it becomes virtually impossible to understand what
they are talking about. Because this article may just
appear somewhere by itself, without the preceeding
articles in a thread.
Keep it in mind.
Again, it is better to write a thorough and detailed
article to put the issue to rest once and for all,
instead of saying the same thing again and again.
You can simply refer people to that original article
instead of doing it from top again, wasting your own
time and energy and producing very lil additional
information with net effect of close to 0.
Most, if not all the articles on this group, or any other,
are available via all sorts of sources on the web, and web
is how it is all read when you really need some answer.
Unfortunately, some people write pretty sloppy articles
with huge blobs of text, without line breaks between
their followup and the original article, long line lengths,
and generally careless style. The result: their articles
are not a great pleasure to read or understand.
Generally, the paragraph size should be limited to separate
different concepts into clearly defined blocks. That makes
it much easier to digest. In today's hectic world, people
are very impatient and will push the next button as soon
as they see the first ugly blob of text.
General suggestions on writing on Usenet:
1. NEVER, under ANY circumstances use lines that are longer
than 70 characters. This is NNTP standard limitations.
All the lines longer than 79 characters will be wrapped
around in in quite an ugly way.
So, considering there may be followups to your article,
and somtimes MANY followups, remember this: each followup
adds at least one character to the line length.
2. NEVER, under any circumstances "top post", meaning
writing your entire response BEFORE the article you are
following up.
Fist of all, it is simply insultive. You couldn't be bothered.
Secondly, it is simply sloppy.
Thirdly, is makes it hard for a reader to put YOUR comments
in the proper context and takes things out of context.
3. Watch the white space around your comments and the
original article. It is best to have at least one blank
line before your follow up and one blank line after.
Extra blank lines do not help anything.
No blank lines makes it all dense and hard to read
as things run into each other.
4. NEVER use tab characters. They are not going to be properly
expanded. Even if you post some code that uses tabs in your
IDE, replace them with spaces.
5. Try to provide a sufficient description and rationale
for things you are saying. Simply making some statement
without reasoning why do you think it is valid is just a
waste.
Readers are not necessarily mind readers. They may not be
on your level of competence or may not know some issues
as good as you. So, if you do not explain why are you saying
this or that, your article will be useless to them.
6. Do not worry about "on-topic" issues for some thread.
Again. Most of the page reads will be done via search
engine and in the web format and not from a news reader.
It does not matter to search engine what is your subject
line more or less. It will still be able to find your
article by looking at its body.
Sure, having the same keywords in subject header and body
will increase the chances your article will come up in
higher postition in the SERPS. But no need to be paraniod
about it and to keep splitting the discussion into new
and new threads unnecessarily. It is better to see how
some subject evoloves.
7. Do not waste your time on personal attacks, humiliation
and insults. That does not buy you anything. It just gets
the discussion deluted with unpleasant things.
If you think YOUR ego is the most important thing in the
world, think again. Because it is about the last thing
the readers would care for. They need answers to THEIR
"problems" and not your "holier than thoug" image.
They could care less.
Summary:
--
Programmer's Goldmine collections:
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.
==============================================================================
TOPIC: different ways of allocating memory
http://groups.google.com/group/comp.lang.c++/t/cae68a10a2667fb5?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Dec 24 2009 3:43 pm
From: "Larry"
"Larry" <dontmewithme@got.it> ha scritto nel messaggio
news:4b32b597$0$1112$4fafbaef@reader2.news.tin.it...
>
> "Maxim Yegorushkin" <maxim.yegorushkin@gmail.com> ha scritto nel messaggio
> news:4b32b260$0$9753$6e1ede2f@read.cnntp.org...
>
typedef struct {
char* titolo;
char* autore;
int annopub;
} LIBRO;
// main
const int nbuff = 5;
LIBRO *l = new LIBRO[nbuff];
l[0].annopub = 2009;
l[0].titolo = "...some chars...";
cout << l[0].titolo << " " << l[0].annopub << endl;
delete[] l;
Why if I just use:
LIBRO *l = new LIBRO;
I can access the structure with the -> operator while with LIBRO[nbuff] I
can only use the dot operator? is there much difference?
thanks
==============================================================================
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