| |
thread by: Krishna |
last post Jul 22 '05 by: Marcin Kalicinski
What is the differnce in these new operators
char *a = new char;
char *a = new char(21);
Do the type of brac matter ?.. If yes what do they signify ?..
|
thread by: Thomas Matthews |
last post Jul 22 '05 by: Peter Kragh
Hi,
In pursuit of a child class blocking a parent's virtual method,
I came up with this example:
#include <iostream>
#include <cstdio>
using namespace std;
class Grandparent
|
thread by: Krish |
last post Jul 22 '05 by: John Harrison
Hi,
I have a question, if I have a global function that pointed to class
or object, then how do I pass arguments to that function.
I have CService *MyService; in my cpp
and in my header, i have
static DWORD CALLBACK function(CService*, DWORD, LPVOID);
DWORD func(CService*, DWORD);
then how do i pass argument for that pointer.
|
thread by: Philipp |
last post Jul 22 '05 by: Mike Wahler
Hello, just a simple question:
Does the close() method of an ofstream object always flush the buffer?
Thanks for answers.
Phil
|
thread by: Alex Vinokur |
last post Jul 22 '05 by: Alex Vinokur
Hi,
GNU g++ 3.4 detects an error in code below.
What is wrong here?
--------- foo.cpp : BEGIN ---------
template <typename T>
struct Foo
{
|
thread by: Erik Friis |
last post Jul 22 '05 by: John Harrison
Hi, I'm trying to create a class template like the following:
template <class Type>
class MyVector
{
MyVector();
~MyVector();
unsigned int MyCount;
Type* MyData;
|
thread by: Steven T. Hatton |
last post Jul 22 '05 by: David Hilsee
I don't really understand the details of what happens when a compiler
inlines a given function. I know that basically it's supposed to cause the
function to be placed directly on the stack per invocation (or something
like that.) That would be in contrast to loading one instance of the
function and branching to it each time.
I don't...
|
| |
thread by: Mark A. Gibbs |
last post Jul 22 '05 by: Ernst Murnleitner
Given this situation:
class Base
{
public:
virtual ~Base();
virtual bool equals(Base const&) const = 0;
};
|
thread by: Chris Gordon-Smith |
last post Jul 22 '05 by: Gary Labowitz
I am currently in India and have treated myself to the Indian reprint
of O'Reilly's "C++ In A Nutshell". (Books in India come in at 1/3 to
1/2 of the price in Britain.)
I thought that I would have a look at what Chapter 12 on grammar says
about Declarations and Definitions. Now I'm more baffled than when I
started.
Here's the problem.
|
thread by: nifsmith |
last post Jul 22 '05 by: John Harrison
Hi
I am creating my own Queue class to learn about Queues and pointers.
I have come across a question of two styles and I don't know if there
are any dangers associated with them.
I coded my remove function as follows
template <class T>
|
thread by: Tatu Portin |
last post Jul 22 '05 by: Tatu Portin
1: #include <iostream>
2:
3: typedef struct {
4: double r;
5: double i;
6: } complex;
..
..
..
24: ostream & operator<< (ostream &str, const complex &a)
|
thread by: Valentina |
last post Jul 22 '05 by: Pedro Graca
What does this C++ line mean?
bool bBoolean = (0!=(nInteger&0x08));
I don't understand the nInteger&0x08 bit.
Thanks,
Valentina
|
thread by: Jonathan Turkanis |
last post Jul 22 '05 by: Jonathan Turkanis
Hi All,
The simple test program at the end of this message defines a class template
foo with a member function bar implemented by delegating to a static member
function of a specialization of the class template bar_impl, nested within foo.
The template bar_impl is partially specialized outside of foo. My question is
which specialization...
|
thread by: Theodore V. Tolstoy |
last post Jul 22 '05 by: Rob Williscroft
Hi!
GCC compiler produces:
test2.cc: In function `int main()':
test2.cc:17: no match for `CTest<char, 1>& + CTest<char, 2>&' operator
when compiling text:
01 template<class T, int S>
|
thread by: marco |
last post Jul 22 '05 by: marco
hi,
i'm trying to get a board with relays working under c++, i have a sample
code in visual basic to compose a string that is send to the serial port
but i am confused how to translate it to a c++ string
here is the vb code:
messagestring = Chr$(13) & Chr$(address) & "S6" & Chr$(checksum)
where adress is an integer from 1 to 255 and...
|
| |
thread by: trabajar |
last post Jul 22 '05 by: John Harrison
I have a piece of software - it compiles fine using nmake (started
from cygwin, using visual c++).
The output of
nmake explorernodequery.dll
is:
----------------------------------------------------------
Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
|
thread by: CD |
last post Jul 22 '05 by: Victor Bazarov
Is this possible:
class base;
class derived; //:public base
vector <base*> bList;
vector<derived*> dList;
//add some derived class pointer entries to dList;
|
thread by: John Smith |
last post Jul 22 '05 by: Ivan Vecerina
Hello,
I made a class which works like bool primitive but has some special
properties.
Now I want to be able to overload an operator to be able to do the
following:
while (myObj)
{
....
|
thread by: K |
last post Jul 22 '05 by: Victor Bazarov
Hi all; I don't think this is a VC compiler question, so I am asking this
here. I did hunt around the web and Stroustrup before posting, but found no
references to this problem.
I have a base class (BasePort) that defines an interface for subclasses
(LPort, NPort). Each implementation of BasePort as LPort or NPort requires
a default...
|
thread by: Steven T. Hatton |
last post Jul 22 '05 by: Steven T. Hatton
While thunbing through _C++ Templates, The Complete Guide_ (reckon I aught
to read it?) I came across a discussion of using templates to "unroll"
loops. I thought that looked like a good idea, so I decided to try it on
some code I'm writing. The idea is to use template objects to perform what
happens in traditional nested for() loops.
...
|
thread by: JT |
last post Jul 22 '05 by: John Harrison
I have a compiler error when using a non-dependent type declared in a
template, if I use the type in function definitions. I think it is a
parsing issues related to confusion with a typename. Below I have a
simple example. Is there another solution I should be using instead of
declaring the type outside of the template?
Thanks,
JT
|
thread by: Lionel B |
last post Jul 22 '05 by: Lionel B
System: Pentium 4, Win32, gcc 3.3.3 cygwin
Does anyone know of a mechanism whereby C library functions can be made
to throw a (C++) exception in case a call fails? This would obviate
having to check the results of function calls individually at the point
of call.
I would also be nice to be able to specify that (some) floating point
IEEE...
|
thread by: stephen henry |
last post Jul 22 '05 by: Michael Kurz
Hi all,
I'm trying to create a vector of pointers to a class:
For example:
class CMb ...
std::vector< CMb* > myvect(100);
|
| |
thread by: Bj?rn |
last post Jul 22 '05 by: JKop
HY,
my problem is the following:
I want to give a very big application the ability, to change the
language at runtime. It's written in Visual C++ 6.0. All language
depending strings and so on, are already stored in different
resource-dll's. The way, I understand it, there is a list of
resources, which the application goes through,...
|
thread by: Martin Magnusson |
last post Jul 22 '05 by: John Harrison
It seems that the following code is not valid, but I need to find a
workaround. Both gcc and Comeau tells me that j can't be used as a
template argument, even though it's declared as a const unsigned. Is
there a way to get around this?
template< unsigned M >
class Tree
{
public:
Tree()
|