Up |
|
|
  |
Author: subramanian100insubramanian100in
Date: Mar 10, 2008 22:48
For vector and deque, the memory layout may be contiguous in which
case we cannot have array of references and so we cannot have
vector and deque. Am I correct?
However I am unable to create
list c;
Though 'list' does not involve contiguous memory layout, the above is
disallowed because we cannot reseat a reference(in the sense that we
cannot rebind a reference to a different object through assignment
operator). Is the reasoning correct; or is there some other reason for
disallowing list of references.
Kindly clarify.
Thanks
V.Subramanian
|
| |
|
| |
12 Comments |
|
  |
Author: subramanian100insubramanian100in
Date: Mar 10, 2008 22:38
Suppose 'Test' is a class:
class Test
{
public:
...
private:
Test& operator=(const Test& rhs)
{
cout << "Test::operator=() called" << endl;
}
};
Suppose I create
Test obj;
vector v;
v.push_back(obj);
Here I get compilation error because Test::operator=() is private (I
kept it as private ONLY for learning purpose). However if I keep
Test::operator=() as public, then it is not called for
'v.push_back(obj)'.
|
| Show full article (0.61Kb) |
|
| |
6 Comments |
|
  |
Author: yourmemoryyourmemory
Date: Mar 10, 2008 21:46
Hello everyone. I'm a graduate student majoring in program analysis.
I'm looking for a full-fledged C++ parser with OCAML interface. Our
team
researched some C++ parsers and found that
Olmar( http://www.cs.ru.nl/~tews/olmar/) was the best candidate among
them. I have two questions about it.
1. Is there a better candidate than Olmar? Please recommend one if
anyone knows about it.
2. If anyone have used Olmar before, I'd like to listen to your
experience with it. I'm curious of its tolerance with various C++
dialects, robustness, and efficiency on the code used in real world.
Thanks in advance for your help.
Best Regards
Soonho Kong
|
| |
|
no comments
|
|
  |
Author: nkavitha551nkavitha551
Date: Mar 10, 2008 21:29
Your Fortune for the Day!!!
Hi,
To know what it is?
Visit the website below and be cool !!!
------------------------------------------------------------------------------
http://myprofilekavitha.blogspot.com/
-------------------------------------------------------------------------------
|
| |
|
no comments
|
|
  |
Author: Jim JohnsonJim Johnson
Date: Mar 10, 2008 21:11
why the struct must be
===================
typedef struct {
... etc ..
} SetupRecord;
CANNOT be ...
===================
struct {
... etc ..
} SetupRecord;
===================
static const SetupRecord g_SetupRecordTable[] = {
{ TEST1, "gggg"},
};
|
| Show full article (1.07Kb) |
|
4 Comments |
|
  |
Author: Jim JohnsonJim Johnson
Date: Mar 10, 2008 21:06
what's the difference when declare a struct with typedef or NO
typedef?
================================
typedef struct {
.... etc
} SetupRecord;
================================
struct {
.... etc
} SetupRecord;
|
| |
|
8 Comments |
|
  |
Author: worlman385worlman385
Date: Mar 10, 2008 20:03
What is that means by putting a list of functions like follows:
: m_eDemoSetup(eDemoSetup)
, m_pActiveGroup(NULL)
, m_pPopupGroup(NULL)
====================================
CRemoteDemo::CRemoteDemo(EDemoSetup eDemoSetup)
: m_eDemoSetup(eDemoSetup)
, m_pActiveGroup(NULL)
, m_pPopupGroup(NULL)
{
// .... etc function definition
}
|
| |
|
no comments
|
|
  |
Author: hurcan solterhurcan solter
Date: Mar 10, 2008 19:20
On Mar 11, 5:03 am, worlman...@ yahoo.com wrote:
> What is that means by putting a list of functions like follows:
> : m_eDemoSetup(eDemoSetup)
> , m_pActiveGroup(NULL)
> , m_pPopupGroup(NULL)
>
> ====================================
> CRemoteDemo::CRemoteDemo(EDemoSetup eDemoSetup)
> : m_eDemoSetup(eDemoSetup)
> , m_pActiveGroup(NULL)
> , m_pPopupGroup(NULL)
> {
>
> // .... etc function definition
>
> }
it's called constructor initializer list and they are not functions,
it's a special syntax that allows you to initialize members of the
class before the body of the constructor executes.
|
| |
|
5 Comments |
|
  |
Author: yogi_bear_79yogi_bear_79
Date: Mar 10, 2008 18:40
I am working on divide-and-average lab. I everything done excep the
syntax for the loop. The loop should run replaceing x with the resutls
of (x + a/x )/2 until x, and (x + a/x )/2 differ by no more than a
given amout, for example 0.00001. I've tried various ideas, the
closest I came was while(x - divavg(a, x) != 0), which more or les
sworked. It stoppend the loop when x = (x + a/x )/2, but I'm not sure
that exactly meets the goal.
|
| |
|
2 Comments |
|
  |
|
|
  |
Author: Eric KaplanEric Kaplan
Date: Mar 10, 2008 18:12
what's difference between using and include?
does using is use for standard library only?
#########################
#include
using std::cout;
using std::left;
using std::right;
#include
using std::setw;
|
| |
|
1 Comment |
|
|
|
|
|