ok, i found some similar posts on stackoverflow, but I couldn't find any that pertained to my exact situation and I was confused with some of the answers given. Ok, so here is my problem:
I have a template matrix class as follows:
template <typename T, size_t ROWS, size_t COLS>
class Matrix
{
public:
template<typename, ...
list<int> foo;
list<int> foo2;
list<int>::iterator foo_end = foo.end();
list<int>::iterator foo2_end = foo2.end();
for (list<int>::iterator it = foo.begin(); it != foo2_end; ++foo) <- notice != comparison here
{
...
it this allowed? will it work correctly.
I am inclined to think that this is implementation dependent, anyone knows ...
I need some help deciding what to use to acquire an image from a webcam. I want to acquire a single image. I know you can typically acquire a still image at a higher resolution than a single video frame.
Currently, I am using MATLAB's image acquisition toolbox.. which apparently only supports obtaining frames in video mode(so lower res...
Which virtual table will be pure virtual function located? In the base class or derived class?
For example, what does the virtual table look like in each class?
class Base {
virtual void f() =0;
virtual void g();
}
class Derived: public Base{
virtual void f();
virtual void g();
}
...
Hi .
I have a methode in a static class which try to convert bi*nar*y tre to list
I'd like to make a recusion but I couldn't
I've implemented some opertation in my class like add,delet,find.it's too easy to implement its .
Here is the code
class ARB
{
private:
struct BT
{
...
Given an STL vector, output only the duplicates in sorted order, e.g.,
INPUT : { 4, 4, 1, 2, 3, 2, 3 }
OUTPUT: { 2, 3, 4 }
The algorithm is trivial, but the goal is to make it as efficient as std::unique(). My naive implementation modifies the container in-place:
My naive implementation:
void not_unique(vector<int>* pv)
{
if (!...
I am doing some performance critical work in C++, and we are currently using integer calculations for problems that are inherently floating point because "its faster". This causes a whole lot of annoying problems and adds a lot of annoying code.
Now, I remember reading about how floating point calculations were so slow approximately cir...
Is there any way to traverse the content of a directory? I would like to store the names of each folder in a given directory.
Thanks!
...
I can imagine one case, in which the input parameter could be NULL so that pass-by-pointer is preferred but not pass-by-reference?
Can anybody add more cases?
...
Hi all!
I have a source code of an OpenSource project which I get from SVN. I was able to run autogen --> configure --> and make successfully (through the terminal). But I want to build the same project with Eclipse, and I can't port manually those source files to eclipse though. So, How can I set Eclipse to use external make files ? ca...
i am doubtful about it that vc++6.0 is .Net framework independent or depends on it help required?
...
Is it possible to capture full screen in visual studio (VC++), so that user don't have to press ATL+Enter. Kindly guide me how I can make it possible.
...
I have some C++ code
#include <cstdio>
#include <boost/bind.hpp>
#include <boost/function.hpp>
class A {
public:
void do_it() { std::printf("aaa"); }
};
void
call_it(const boost::function<void()> &f)
{
f();
}
void
func()
{
A *a = new A;
call_it(boost::bind(&A::do_it, a));
}
which gcc 4 compiles into the following as...
class member
{
public:
member()
{
cout<<"Calling member constr"<<'\n';
}
member(const member&)
{
cout<<"Calling member copy constr"<<'\n';
}
};
class fred
{
public:
fred()
{
cout<<"calling fred constr"<<'\n';
}
fred(const fred &)
{
cout<<"Calling fred copy constr...
win32 windows application and want to capture full screen and remove the border of window displayed any one tell me how can i do so if this window capture the mouse keyboard controls then it will be ideal?
// MonitorScreen.cpp : Defines the entry point for the application.
//
include "stdafx.h"
include "MonitorScreen.h"
define MAX_L...
Hi,
How do I differentiate in my C++ code between a service coming up as a part of system reboot and service coming up since the user stopped and started the service manually in service manager or using sc tool????
...
As far as I know, in case of an uncaught exception, C++ destroys the local variables immediately, Java releases the references and leaves the rest for the garbage collector.
Is this right? What exactly is the difference between Java and C++ on this issue? in other words, which of these two languages is considered better in terms of stac...
Can anybody help me with this simple code??
#include <iostream>
using namespace std;
void testFunction(){
cout<<"This is the test function 0"<<endl;
}
void testFunction1(){
cout<<"This is the test function 1"<<endl;
}
void testFunction2(){
cout<<"This is the test function 2"<<endl;
}
void (*fp[])()={testFunction,testFunc...
Hi,
I'm trying to generate the accessors and mutators for my variables automatically, but just can't find a way. I tried the right-click/refactor... solution, but the refactor item doesn't appear.
I'm not in the mood right now to learn how to write a macro to do this, and I don't have the money to buy a commercial solution (internship s...
Is it possible to do a macro that copies a definition of a function to a declaration(, and maybe also the opposite)? For instance
Foo::Foo(int aParameter, int bParameter){
//
}
int Foo::someMethod(char aCharacter) const {
return 0;
}
from the .cpp file would be:
class Foo {
Foo(int aParameter, int bParameter);
i...