c++

Structs in C++ can be modified? or there is a restriction?

I have this class which has a double list template of a struct of two chars and another struct typedef struct KeyC{ char K[5]; char C[9]; } TKeyC; typedef struct Bin{ char Car; char Cad[9]; TKeyC *KC; } TBin; class Bo { private: TDoubleList<TBin> *Ent; public: ... } I have a method ...

Is there any software or library available to draw screws in 3 dimensions in C, C++, Java, or Ruby?

Is there any software or library available to draw screws in 3 dimensions in C, C++, Java, or Ruby? ...

How to turn a function of 3 nested loops into one recursive function?

what would the recursive version for the following function would be like: void tri_loop(size_t i, size_t j, size_t k) { for(size_t x = 0; x < i; ++x) for(size_t y = 0; y < j; ++y) for(size_t z = 0; z < k; ++z) { cout << x <<y << z; } } Just for mental drilling.(Edit: emp...

LCID of machine in domain ?

How can we get LCID of machine located in network domain using C++ ? ...

Making plot in Qt

I need to implement some plot like that or that in my app , it can be even something similar. I made a search on Qt web site with no progress , and i saw Qwt package but nothing similar there . Any ideas ? Thanks a lot . ...

Browsing WPD's content through Windows Explorer

I noticed that when I plug in my Nokia phone, an icon will appear in My Computer in windows explorer and I can browse the content of my phone through windows explorer. Is this concept similar to developing Shell Namespace Extension for virtual folder? I notice that Shell Namespace Extension is categorised as System Folder while my phone...

Can I use std::stack as object pool container?

I need to create a pool of objects to eliminate dynamic allocations. Is it efficient to use std::stack to contain pointers of allocated objects? I suspect every time I push the released object back to stack a new stack element will be dynamically allocated. Am I right? Should I use std::vector to make sure nothing new is allocated? Tha...

Can I use a "\n" character in strings that are to be translated with Qt Linguist

Hi, I'm working on supporting different languages for our GUI. I'm having a problem translating strings that have a '\n' in them. They seem to be ignored. In Qt Designer I have a QCheckBox with this in the text field: Here's an \nexample that doesn't work This appears in english in our french translation. Having looked at the .ts X...

generating random alphabets with some alphabets having a higher frequency of occurence(vc++6.0)

basically i have a function that generates random alphabets .i have done this using the rand() function to generate numbers and them converted them to their corresponding ascii equivalents. but i want the vowels to be generated in higher numbers as compared to other alphabets.i.e if have generated say 10 alphabets then there should be li...

How to format/change qmake build output

Hello, how can I format the make output (!!by only changing the qmake project file!!). My compilation lines continue growing, and the one-line-warnings/errors almost disappear between them. I am thinking of something like $(CC) in.ext -o out.ext thanks in regard ...

Why code segment is Common for different instances of same program

Hi, I wanted to know Why code segment is common for different instances of same program. For Eg: Consider program P1.exe running, if another copy of P1.exe is running, code segment will be common for both running instances. Why is it so ?. Answer will be highly appreciated. Thanks in advance. ...

best lib for vector array in c++

I have to do calculation on array of 1,2,3...9 dimensional vectors, and the number of those vectors varies significantly (say from 100 to up to couple of millions). Of course, it would be great if the data container can be easily decomposed to enable parallel algorithms. I came across blitz++(almost impossible to compile for me), but a...

Can C++ automatic variables vary in size?

In the following C++ program: #include <string> using namespace std; int main() { string s = "small"; s = "bigger"; } is it more correct to say that the variable s has a fixed size or that the variable s varies in size? ...

MFC IMPLEMENT_DYNCREATE with template

Hello, Is there any way to use IMPLEMENT_DYNCREATE with an template class? If not maybe someone could explain why?Or maybe there is another solution to this? :) Example: template<typename T> class A : public B{ public: A(){ printf("A constuctor "); } void fn( ){ T* a = new T(); } }; IMPLEMENT_DYNCREATE(A<CObject>, B); ...

What language would you use to implement auto-update/sync functionality on a memory stick?

We need to distribute documents to our partners on a USB key. I've been asked to develop a piece of software that will check if some documents have been updated on the server and proceed with the synchronization of files on the memory stick. The software itself will also need to have an auto-update functionality in case we want to impr...

Which library would you consider on linux for DEA (Data Encryption Algorithm)?

I need a 3DES encrypt/decrypt library for my project. Do you know an implementation working on linux ? Linux is the target platform, but I essantially compile/debug on Windows. Therefore it could be really appreciated if it could work on Windows, while not mandatory. ...

Initialization order with constructors in C++

By instantiating an object in C++ with the following class I get a segmentation fault or aborts, depending on the order declaring member variables. E. g. putting mMemberVar and mAnotherMemberVar after mAnotherCountVar results in a segfault. From this listing I removed a std::ofstream from the member variables, which caused the segmentati...

Is it possible to generate types with all combinations of template arguments?

I have a templated class template<class U, class V, class W> class S { //... implementations }; and some stock type implementations for type U, V and W: typedef boost::mpl::vector<U0, U1> u_types; typedef boost::mpl::vector<V0, V1, V2, V3, V4> u_types; typedef boost::mpl::vector<W0, W1, W2, W3, W4> w_types; I want to test class S...

Deleting a method from Visual Studio properties window

The "Events", "Messages" and "Overrides" tabs in the Properties Window can be used to add new methods to a class as well as to remove them. However, when you select to "Delete" a method, it comments the method code instead of deleting it. I know this is for safety issues, but I almost never need the commented code and end up having to d...

C++ expected type specifier error

I am trying to write a wrapper function to figure out who is calling a specific function. So in .h file I added the following: (and implementation in the .cc file) extern int foo(/*some arguments*/); extern void call_log(const char*file,const char*function,const int line,const char*args); #define foo(...) (call_log(__FILE__, __FUNCTI...