comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c++ Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  associative containers and algorithms         


Author: subramanian100in
Date: May 5, 2008 22:14

I am copying the following lines as it is, from Stanley Lippman's C++
Primer 4th edition, page 418(First paragraph).

It says:
"Although the map and set types provide bidirectional iterators, we
can use only a subset of the algorithms on associative containers. The
problem is that key in an associative container is const. Hence, any
algorithm that writes to elements in the sequence cannot be used on an
associative container. We may use iterators bound to associative
containers only to supply arguments that will be read."

Here, consider the line "any algorithm that writes to elements in the
sequence cannot be used on an associative container".

Consider the code fragment:

typedef set s_type;
s_type s1;
s_type s2;

// store some values into s1 and s2.

s_type dest;

merge(s1.begin(), s1.end(), s2.begin(), s2.end(),
inserter(dest, dest.end()));
Show full article (1.47Kb)
3 Comments
  Shootout (sum-file)         


Author: Razik
Date: May 5, 2008 21:23

On Wed, 30 Apr 2008 08:00:38 -0700 (PDT), Isaac Gouy
yahoo.com> wrote:
>Why don't you go through all...

Let's continue. Next we deal with sum-file...

http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all#about

"Programs should use built-in line-oriented I/O functions rather than
custom-code. No line will exceed 128 characters, including newline.
Reading one line at a time, the programs should run in constant
space."

According to Haskel people,

"Those guys tell us these benchmarks don't favor C and then impose a
limit on line length? What's the purpose of that if not to allow the
use of C's getline() primitive?"

That's a valid point that you need to address. Why 128 characters
limit if not to help C and C++ guys?

In any case,
C++
http://shootout.alioth.debian.org/debian/benchmark.php?test=sumcol&lang=gpp&id=2
Show full article (1.23Kb)
32 Comments
  Sunrise East Asia Sporting Goods Co.,Ltd         


Author: tradeinputian.005
Date: May 5, 2008 21:22

Dear my friend
It is our pleasure to meet you here.
we are Sunrise East Asia Sporting Goods Co.,Ltd in Fujian of China.
our website: http://www.trade-in-putian.cn
no comments
  STL objects and binary compatibility         


Author: osama178
Date: May 5, 2008 20:40

Hi,

What does it mean for an object to be binary compatible? And why
aren't STL objects binary compatible? Any insights, links, resources
for further reading are greatly appreciated.

Thanks.
23 Comments
  problem with a reverse iterator         


Author: brad
Date: May 5, 2008 14:55

In the example below, possible_number is a string of one or more
digit(s). For example, it may be 4 or 4444. However, when I attempt to
perform the times 2 calculation, the ASCII value of 4 (which is 52) is
used instead of 4 itself. I need to be able to easily reverse the order
of the digits and to only perform this calculation on even positioned
digits... that's why I'm using string instead of int. Any suggestions on
how to make 4*2 = 8 I've tried atoi() type casting, etc. I'm stuck.
Still learning c++.

Thanks for any help!

int position = 0;
Show full article (0.88Kb)
3 Comments
  Binary Search Tree         


Author: pleatofthepants
Date: May 5, 2008 13:39

I have a Binary Search Tree and a function called inOrder

void inOrder (TreeNode*, ostream& out)

which is being called like this: a.inOrder(cout);

But it will not work because the parameters are not the same. The
function call has to be the same but what can I change in the function
to allow this?
1 Comment
  Acheter xenical en ligne sur internet xenical suisse soft bon marche xenical canada soft sans prescription Achat xenical canada france generique pharmacie en France acquerir xenical canada soft         


Author: thomas1sum
Date: May 5, 2008 12:30

Acheter xenical en ligne sur internet xenical suisse soft bon marche
xenical canada soft sans prescription Achat xenical canada france
generique pharmacie en France acquerir xenical canada soft

+++ PERTE DE POIDS +++ PERTE DE POIDS +++ PERTE DE POIDS +++
+
ACHETER ACOMPLIA BON MARCHE (ALL CARD ACCEPTED)
http://jhku.net/ACHETER-ACOMPLIA-BON-MARCHE/

ACHETER ACOMPLIA BON MARCHE (Western Union, Diners, AMEX)
http://WWW.ACHETER-ACOMPLIA.TK/
+
+
+
ACHETER XENICAL BON MARCHE (ALL CARD ACCEPTED)
http://jhku.net/ACHETER-XENICAL-BON-MARCHE/
Show full article (2.08Kb)
no comments
  nested for loop problem         


Author: notahipee
Date: May 5, 2008 11:42

Would someone be able to tell me why this isn't working. The nested
for loops seem correctly coded to me. I would appreciate any input.

#include
#include

int main ()
{
int a, b, c, d;

cout << "Enter two integers ";
cin >> a >> b;

for (c=a; c==b; c++)
{
for(d=2; d<=sqrt(c); d++)
{
if(c%%d==0)
continue;
Show full article (0.48Kb)
9 Comments
  std::stack compilation error         


Author: Rahul
Date: May 5, 2008 08:19

Hi,

I have the following program,

void dfs(struct node * root)
{
if(root == NULL) return;
std::stack s;
s.push(root);

while(!s.empty())
{
struct node * temp = s.pop();
printf("%%d ",temp->data);
s.push(temp->rptr);
s.push(temp->lptr);
}
}

and i get a error saying,

ro.c: In function `void dfs(node*)':
ro.c:419: `stack' undeclared in namespace `std'

Am i missing something?
Show full article (0.45Kb)
2 Comments
  calling "after return"...?         


Author: .rhavin grobert
Date: May 5, 2008 06:03

[insert ya favorite greetin' here;-)]

guess you have the following classes...
___________________________________
class {
//..a couple of methods ...//
};

class A {
public:
//...//
B* GetB() // <- this we'll talk about
private:
B* m_pB;
};

A::GetB() {
//..some code..//
return m_pB;
};
___________________________________

when some does a...
Show full article (0.78Kb)
5 Comments
 
1 2