Possible Duplicate:
How do I create a file with a user-supplied name in C++?
I was wondering how to have the user enter some text and the program create a file with the text entered by the user as the name of the file.
Thanks In Advance!!
...
I have been using the gcc compiler with code::blocks ide, and have noticed there are some things missing in the commctrl.h which are:
PBS_MARQUEE and PBM_SETMARQUEE to set a progress bar to marquee animation style.
LVS_EX_DOUBLEBUFFER for a double buffer on a list view...
there are probably a lot more missing, but these are the ones i...
Possible Duplicate:
Create Random Number Sequence with No Repeats
I'm trying to generate unique session IDs. Each session ID is a random integer. The main requirement is that each session ID is unique. I'm trying to find the most efficient algorithm to do this.
Scenario: Generate 10 random numbers from 1 to 10 inclusive.
My...
I'm currently trying to write a .bmp file in C++ and for the most part it works, there is however, just one issue. When I start trying to save images with different widths and heights everything goes askew and I'm struggling to solve it, so is there any way to force something to write to a specific byte (adding padding in between it and ...
I have read numerous times that enforcing const-correctness in your C or C++ code is not a good practice with regards to maintainability, but also it may allow your compiler to perform optimizations. However, I have read the complete opposite, too that it does not affect performance at all.
Therefore, do you have examples where const c...
I'm trying to use SFINAE to distinguish a class that has a member called 'name'. I set things up in what seems to be the standard pattern but it's not working -- instead of silently ignoring the 'failed' substitution, the compiler produces an error.
I'm sure I've run up against some template substitution rule, I'd be grateful if someon...
I am compiling a program with Visual C++ 2010 but I don't want everyone to have to download the redistributable package to run my programs. Most people that will be using my program already have the VC++ 2008 redistributable package though, so is there a way I can compile it with compatibility with VC 2008? Or is there a place I can down...
i have created a form using visual c++. all im trying to do is this when a button is clicked the form is gone and new window will be showen. i don't know if i should repaint the window or there is another solution? please help
Rami
...
I am documenting some code which uses meta-programming heavily, for example:
template<rysq::type A, rysq::type B, rysq::type C, rysq::type D, class Transform>
struct Kernel<meta::braket<A,B,C,D>, Transform,
typename boost::enable_if<
quadrature<meta::braket<A,B,C,D>, Transform> >::type>
: Eri <Transf...
Here is a sample program that uses stringstream. The goal is to accept lines from the user(standard input) and print each word in a separate line.
int main()
{
std::istringstream currentline;
std::string eachword;
std::string line;
// Accept line from the standard input till EOF is reached
while ( std::getline(std:...
Any one has BK-Tree implementation in C++.,
...
Hi, i need help.
c++:
static void doIp(byte data[])
{
unsigned char j, k;
byte val;
byte buf[8];
byte *p;
byte i = 8;
for(i=0; i<8; i++)
{
val = data[i];
p = &buf[3];
j = 4;
do
{
for(k=0; k<=4; k+=4)
{
p[k] >>= 1;
if(val & 1) p[k] |= 0x80;
val >>= 1;
}
...
I have C++ code that relies heavily on sampling (using rand()), but I want it to be reproducible. So in the beginning, I initialize srand() with a random seed and print that seed out. I want others to be able to run the same code again but initializing srand() with that same seed and get exactly the same answer as I did.
But under what ...
I'm using Boost.Property_Tree for a project and I want to add a small bit of functionality to it. I want to add a "fromFile" static member variable that will figure out the file type and then use the proper parser. In my project, this is currently how I've got it.
typedef boost::property_tree::ptree ConfigNode;
Then I have another cla...
Possible Duplicate:
C++ IDE for Linux?
what is the best IDE to develop large c/c++ apps on Linux which will provide capabilities to debug/search references etc.
...
I have a function with the prototype
DWORD WINAPI blah(LPVOID arg);
Which was meant to be used with CreateThread for a threaded app.
I call it with CreateThread with no problem. But then somewhere else in the code, I call it normally, just by blah(NULL). When it gets to this part, it crashes. Is this because the WINAPI part makes it ...
I just asked this question and the good answers mentioned using an initialization list. So I looked it up in many various places. It was often said that one can use an initialization list to select which constructor to use.
class First
{private:
int a, b, c;
public:
First(int x);
First(int x, int y);
}
First::First(int x...
What is the Message that matches the TextChanged property in .NET for C++\Win32?
...
I've read about Small-Object Allocation in "Modern C++ Design". Andrei Alexandrescu argues that the general purpose operators (new and delete) perform badly for allocating small objects.
In my program there are lot of objects created and destroyed on the free store. These objects measure more than 8000 bytes.
What size is considered sm...
Hi,
I'm making a basic program in C# wich calls a C++ dll. I give the pannel's handle to the dll so OpenGL knows where to draw.
[DllImport(@"../../../Debug/Model.DLL")]
public static extern void startOpenGL(IntPtr hWindow);
I mashall IntPtr hWindow to HWND hWindow.
after I call draw from C#
[DllImport(@"../../../Debug/M...