Hi,
I have a system that returns a void* to a memory block. This memory block stores contiguous data records of different types(int,char,double etc.) and gives the number of bytes of each field in each record.I essentially look up the type of the record and get the value of the record. To retrieve all the records, I do
switch(type)
{
...
I looked at boost's mpl::string, but there doesn't seem to be an easy way of converting string literals to the single-quotation-integer-based format of mpl::string. What I am trying to do is to generate at compile time an XML realization of some simple data structures using compile time strings. I am striving for having macros generate t...
Hi
For a Qt/C++ project we will use doxygen to generate some documentation,
therefore I'm searching for a "optimal" config file.
One thing that I was thinking about is that you have stuff like
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
But I can't find something ...
As a hobby project, I had like to implement a Morse code encoder and decoder in C++ and Python (both). I was wondering the right data structure I should use for that. Not only is this question related to this specific project, but in general, when one has to make predefined text replacements, what is the best and the fastest way of doing...
Hello,
I am trying to test an application in Windows for memory leaks. I have looked at Linux alternatives (eg. Valgrind) and I am looking for a similar tool for Windows. The problem with .Net is that the memory is not released straight away like in Linux.
My knowledge of .Net is limited so my problem is I would like to use a tool tha...
Hi,
I would like Visual Studio to automatically put my .h file in a folder /ProjectPath/include and my src file in /ProjectPath/src. That way, if I use the "Create class wizard" for instance, it would put the good path by default without me having to change the folder. Anyone know what setting I should change to get this behaviour when...
I want to sort chopsticks by weight and I want the matching pair of chopstick at the end of program. Should I use sort algorithm? I want to sort it by weight means (e.g 110, 90, 110, 90) so in this case I got 2 pair. One having weight 90 and other having weight 110, but how can I track that? I know I have to use counter but how I don not...
I would like to learn game programming. Just to give you a background I am a programmer and understand the concepts of programming and am very object oriented.
I have worked with languages such as php, javascript, flash, java, and a little c++. Now from my understanding most of game programming is done in either python
or c++. Now I hav...
This is a specific gcc related question. I have a library compiled with g++ 4.1.2 that I want to give the user. The user can use our API in their code and link our library to create the final executable.
The question I have is related to g++ version compatibility. Some of our users are using g++ 4.4.3, others 4.3.3, and still others 4.2...
I have a class called options written in c++, here is the header info:
class Options {
public:
string filename;
string chunkDir;
string outFilename;
string inFilename;
BOOL compress;
BOOL extract;
BOOL print;
BOOL reconstruct;
int bits;
Options(string inFilename);
Options(int argc, char** argv);
void unsupported(string s);
v...
I'm trying out g++ inline assembly and sse and wrote a first program. It segfaults - why?
#include <stdio.h>
float s[128*4] __attribute__((aligned(16)));
#define r0 3
#define r1 17
#define r2 110
#define rs0 "3"
#define rs1 "17"
#define rs2 "110"
int main () {
s[r0*4+0] = 2.0; s[r0*4+1] = 3.0; s[r0*4+2] = 4.0; s[r0*4+3] = 5.0;
...
It's trivial to get the size of a struct's field in C++ if you have an instance of the struct. E.g. (uncompiled):
typedef struct Foo {
int bar;
bool baz;
} Foo;
// ...
Foo s;
StoreInSomething(s.bar, sizeof(s.bar)); // easy as pie
Now I can still do something like this, but with the interface I'm implementing (I get a BOOL t...
Hi, I'm having trouble statically linking an app which uses the boost 1.35 libraries. I'm using a linux debian Lenny box, with G++ 4.3.2. Linking without -static works without a hitch.
Specifically,
g++ -Wall -Wextra -pedantic -ggdb3 -O0 -static -l boost_thread-mt -lboost_system-mt -lboost_program_options-mt -lssl -lpthread -l crypt...
I am writing a cross-platform C++ program for Windows and Unix. On the Window side, the code will compile and execute no problem. On the Unix side, it will compile however when I try to run it, I get a segmentation fault. My initial hunch is that there is a problem with pointers.
What are good methodologies to find and fix segmentation ...
Hello
I have an instance of IFilterGraph - my own graph with video filters (source, transofrm and renderer). How can I obtain the current fps (video frame rate) of running graph?
Regards
Dominik
...
My professor asked us to generate UML for next homework. We are using Visual studio 2010 for c++ programming. I tried to work on it but I could not figure out, I went to Architecture-> Windows -> UML Model Explorer but don't understand where to go next. Is UML generator creates UML automatically or it will just give bunch of boxes to fil...
im trying to make a simple game engine, it consists of 2 classes, Game
class Game
{
protected:
SDL_Event event;
vector<Sprite> render_queue;
void render();
public:
int SCREEN_WIDTH,
SCREEN_HEIGHT,
SCREEN_BPP,
FPS;
SDL_Surface *screen;
Game(int...
I have trouble with the jvm.dll when after the returning from the function below I get the error message _HEAP[test_heap.exe]: Invalid Address specified to RtlValidateHeap_
At the moment I dynamically load the JNI_CreateJavaVM method only, everything goes well until I go past the final return statement of the function test_heap below:
...
I'm having a project which compiles perfectly with gcc, but fails to compile under Greenhills Integrity environment.
The problem boils down to this three files:
MyVector.cpp // contains function testVector
MyVector.hpp // contains template vector<>
SomeFile.cpp
MyVector.hpp contains template-class for a vector, and MyVector.cpp conta...
I am working with mixed Native and Managed Visual C++, using STL in the Native. I have a strange problem. It seems that when I compile my software in Release mode with all the optimizations set, my software consistently runs slower than in Debug mode. What could be wrong here?
These are my Debug command line options:
/Od /D "WIN32" /D ...