I'm not sure why is this. I'm distributing a static *.lib across multiple projects, but this static lib generates many *.obj files. Seems like I need to distribute also those *.obj files with the *.lib. Otherwise, I get this error:
1>LINK : fatal error LNK1181: cannot open input file 'nsglCore.obj'
Why is this? Is there a way to inclu...
When I try to use my iterator class
template<class T>
class list
{
public:
class iterator;
};
template<class T>
class list<T>::iterator
{
//stuff
};
as a return type in an operator overloading,
template<class T>
class list<T>::iterator
{
public:
iterator& operator++();
protected:
list* lstptr;
};
template<class T>
iterator& list<T>...
In my native windows mobile app I've got a window that creates a dialog. Lets say my window handle is hMainWnd.
I create the dialog using DialogBoxParam() and passing in hMainWnd as the dialog's parent:
DialogBoxParam(_,_,hMainWnd,_,_);
Let's say the dialog's handle is hDlgWnd. From within the dialog, GetParent() returns hMainWnd ...
I once saw this line of code:
std::cout %lt;%lt; "Hello world!" %lt;%lt; std:: endl;
And am wondering what %lt;%lt; means.
...
MSVC 2008 won't compile this code:
template <class Derived>
struct B
{
typename Derived::type t;
};
struct D : B<D>
{
typedef int type;
};
void main()
{
D d;
}
The error I get is "error C2039: 'type' : is not a member of 'D'". Any ideas?
...
Hello all. I'm a "good" programmer. I know Haskell, OCaml, and other functional languages very well. I know also Smalltalk, Objective-C, and other OO languages. I spend my time on LtU, I know a fair amount about programming language theory and compiler design, and above all, I'm, ahem, incredibly brilliant.
That said, I'm also hungry, a...
Hi all
I am facing a strange problem. I am using sprintf or swprintf according to the build defines with or without unicode. I have wrapped these functions in my own function like this:
int mysprintf( MCHAR* str,size_t size, const MCHAR* format, ... )
{
#ifdef MYUNICODE
return swprintf( str, size, format);
#else
return snprintf...
Duplicate of http://stackoverflow.com/questions/743545/how-to-allow-more-memory-and-avoid-stack-overflow-on-lots-of-recursion
I'm writing a branch and bound algorithm which has at least 10000 levels by a recursive function,but it doesn't work due to a stack overflow error. here is a simple instance of my program in C++:
void f(int k)
{...
I need an algorithm to select the kth largest or smallest value. The values will be ints. My instructor told me to use a modified partition algorithm to find the kth largest or smallest value. Any thoughts?
...
Hello all,
I have a vector of pointers to a class. I need to call their destructors and free their memory. Since they are vector of pointers vector.clear() does not do the job.So I went on to do it manually like so :
void Population::clearPool(std::vector<Chromosome*> a,int size)
{
Chromosome* c;
for(int j = 0 ;j < size-1;j++)
...
I want to buy a brand new notebook for out-of-the-office work. I mainly develop using VC++ (vs03) and c# (vs08) on large projects (10 gb builds).
At office I've a quad core xeon with 10.000 rpm disk.
What hardware, according to your experience, is the best for this kind of work in terms of price / performances / weight?
...
I have a basic class that derived subclasses inherit from, it carries the basic functions that should be the same across all derived classes:
class Basic {
public:
Run() {
int input = something->getsomething();
switch(input)
{
/* Basic functionality */
case 1:
doA();
break;
case 2:
...
This is a simplified example to illustrate the question:
class A {};
class B
{
B(A& a) : a(a) {}
A& a;
};
class C
{
C() : b(a) {}
A a;
B b;
};
So B is responsible for updating a part of C. I ran the code through lint and it whinged about the reference member: lint#1725.
This talks about taking care over defaul...
Hi,
I am trying to modify the amcap, an application from Windows SDK's example to capture video from UVC webcam having resolution 1600x1200px.
I am trying to hardcode some variables here like filename, default resolution, type of format etc.
WCHAR wszCaptureFile[260];
gcap.wszCaptureFile = (WCHAR)"Capture.avi\0" //modified
gettn...
Hi,
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and ANSI. After doing some research I have some idea but it would be really useful if someone could explain exactly the difference between them (including the byte representation of a typical character from each).
I quess my question boils down t...
hi,
i am using encrypt function of cryptography api(fun declared as virtual)
//fun declaration
TBool EncryptL(const TDesC8 &aInput, TDes8 &aOutput);
//function calling
TBuf8<10> text;
TBuf8<10> cipher;
text.Copy(_L("Hello"));
iEncryptor.EncryptL(text,cipher); it shows error expression syntax error
//fun definition
TBool CRSAAlgo::Enc...
I was reading a blog post by a game coder for Introversion and he is busily trying to squeeze every CPU tick he can out of the code. One trick he mentions off-hand is to
"re-order the member variables of a
class into most used and least used."
I'm not familiar with C++, nor with how it compiles, but I was wondering if
This sta...
Hello, I am creating an application that uses popups. However, I would like to animate this popup (a win32 window, a HWND), for example having it slowly extend from the bottom of my screen, moving upwards. Should I make a few dozens of calls to the SetWindowPos function with a small pause in between, or is there a better way to do this, ...
I have a QTransform object and would like to know the angle in degrees that the object is rotated by, however there is no clear example of how to do this:
http://doc.trolltech.com/4.4/qtransform.html#basic-matrix-operations
Setting it is easy, getting it back out again is hard.
...
Does the Sun compiler have a notation to mark functions as deprecated, like GCC's __attribute__ ((deprecated)) or MSVC's __declspec(deprecated)?
...