struct B1{
int d;
void fb(){};
};
struct B2 : B1{
using B1::d;
using B1::fb;
int d; // why this gives error?
void fb(){} // and this does not?
};
int main(){}
Is it because, B1::fb() is treated as B1::fb(B1*) and B2::fb() treated as B2::fb(B2*)? That is, does the implicit parameter, help in disting...
i have some misunderstanding about tellp, seekg ... functions for example when i run following code
#include <iostream>
#include <ostream>
#include <fstream>
using namespace std;
int main(){
string s("in georgia we are friend to each other");
ofstream out("output.txt");
for (int i=0;i<s.length();i++){
cout<<"file...
The source from here says that it is supposed to work on the iPhone. I have worked with it, but I get 2 errors, saying that msleep() is undeclared. I have tried to include unistd.h, time.h, and numerous others. How can I get this to work? Thanks.
...
Instead of creating 4 different libs (one for MT, MTd, MD, MDd) I want to create a lib that does not specify its dependency on C runtime library (CRTs).
I tried to pass "/c /Zl" option to vc10 compiler, then /NODEFAULTLIB to lib command. Later when I use such lib I still have errors when I compile my program with switch different than d...
Hi all !
I have some doubts while comparing C++ and Java multiple inheritance.
Even Java uses multiple, multi-level inheritance through interfaces - but why doesnt it use anything like a virtual base class as in C++ ? Is it because the members of a java interface are being ensured one copy in memory (they are public static final), and...
I am not very proficient in Mac OS X programming, but I am working on a Qt application which needs info about the storage devices. Basically a list of hard drives and USB thumb drives.
The end result should be like a vector which contains the following info for each device:
string: Label
string: Mount point
string: Device description (a...
What is the difference between C++ memory management and .NET memory management ?
...
I am currently using the following code but its very slow for large numbers
static int divisor(int number)
{
int i;
for (i = number / 2; i >= 1; i--)
{
if (number % i == 0)
{
break;
}
}
return...
Hi all,
i have gone through the numerous questions regarding signed/unsigned char. I understand there are three distinct char types in C++. Currently i have a large code-base which is compiled with Visual Studio - the "default char unsigned" setting is set to "No". Now i'm supposed to add a particular project to our code-base (integrate...
Hi,
I am not sure about a good way to initialize a shared_ptr that is a member of a class. Can you tell me, whether the way that I choose in C::foo() is fine, or is there a better solution?
class A
{
public:
A();
};
class B
{
public:
B(A* pa);
};
class C
{
boost::shared_ptr<A> mA;
boost::shared_ptr<B> mB;
void...
Hi , I am going to use CDash with CMake/CTest on my C++ project.
In order to enable CDash and customize settings, like
"MEMORYCHECK_SUPPRESSIONS_FILE", "DART_TESTING_TIMEOUT", I added the following lines in the root CMakeLists.txt
set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_SOURCE_DIR}/valgrind.supp")
set(DART_TESTING_TIMEOUT "120"...
for(i=1;i<=(n-1);i++)
{
for(j=(i+1);j<=n;j++)
{
T=a[i,j];
a[i,j]=a[j,i];
a[j,i]=T;
}
}
...
since last four years i had been coding in c/c++, but those lenthy programs made me sick of them.
then i got to know about python, and i have learned the basics.
python seams to be more flexible and powerful than c++...
But i want to know is python realy better than c++?
if yes/no in what ways , please explain.
since i am a student ,...
Hi,
I was using some gnome applications like empathy and gwibber, and was wondering how to create a "conversation" effect in my own gtk application.
E.g. http://www.ubuntu.com.cn/files/1004features/01.jpg (off google, not my site)
Thanks
...
I'm trying to run Fortify on a Visual Studio 2008 project. The project builds successfully on its own. When I try to analyze the project with Fortify using the Visual Studio integrated controls, the project builds successfully but an error message is thrown. Here's the output from Fortify console:
Fortify SCA...
Running: "-show-runtime-...
Say I have a function f(a, b, c). Is it possible to create function pointers g and h such that when you use g and h they use a predetermined value for one of the arguments?
For example (*g)(b, c) would be equivalent to f(1, b, c) and (*h)(b, c) would be equivalent to calling f(2, b, c).
The reason why I am doing this is that I am calli...
How do I run a single test with UnitTest++ ?
...
I have an application that sends requests to an out of proc COM server whom handles the requests and sends them back to the requesting application.
The client application is really in control of the start-stop of this Out-of-Proc COM server and determines its lifetime so to say.
Because this application has many hundreds of requests ...
Below is a purely academically invented class hierarchy.
struct X{
void f1();
void f2();
void f3();
};
struct Y : private X{
void f4();
};
struct Z : X{
};
struct D : Y, Z{
using X::f2;
using Z::X::f3;
};
int main(){}
I expected using declaration for X::f2 to be ambiguous as 'X' is a...
Anyone knows of such a simpliest hello world app ?
...