c++

Creating a particle attractor in DirectX [solved]

Edit: Solved it on my own, had one of those small typos that are hard to notice in a different section, works perfectly now. I have a particle generator in C++ that I got off the internet. It was basically a sample of some things you can do, so I have studied it and know what is going on and what I need to do to add the features I want ...

Cross-platform drawing library

I've been looking for a good cross-platform 2D drawing library that can be called from C++ and can be used to draw some fairly simple geometry; lines, rectangles, circles, and text (horizontal and vertical) for some charts, and save the output to PNG. I think a commercial package would be preferable over open source because we would pre...

floating point precision

I have a program written in C# and some parts are writing in native C/C++. I use doubles to calculate some values and sometimes the result is wrong because of too small precision. After some investigation i figured out that someone is setting the floating-point precision to 24-bits. My code works fine, when i reset the precision to at le...

Using glTexSubimage2d with a dynamically sized texture array

Have anyone tried this (stackoverflow.com/questions/679210/how-can-i-use-a-dynamically-sized-texture-array-with-glteximage2d) with glTexSubImage2D instead? I really need it and I can't put it to work properly, all I get is a striped, funny coloured square on my original texture. Thanks in advance. ...

How to identify top-level X11 windows using xlib?

I'm trying to get a list of all top level desktop windows in an X11 session. Basically, I want to get a list of all windows that are shown in the window managers application-switching UI (commonly opened when the user presses ALT+TAB). I've never done any X11 programming before, but so far I've managed to enumerate through the entire wi...

Syntax error compiling header containing "char[]"

I am trying to build a Visual C++ 2008 DLL using SDL_Mixer 1.2: http://www.libsdl.org/projects/SDL_mixer/ This is supposedly from a build made for Visual C++, but when I include SDL_mixer.h I get error C2143: "syntax error : missing ';' before '['". The problem line is: const char[] MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"; Is th...

What is the Fastest Method for High Performance Sequential File I/O in C++ ?

Assuming the following for... Output: The file is opened... Data is 'streamed' to disk. The data in memory is in a large contiguous buffer. It is written to disk in its raw form directly from that buffer. The size of the buffer is configurable, but fixed for the duration of the stream. Buffers are written to the file, one after another. ...

private non-const and public const member function - coexisting in peace?

I am trying to create a class with two methods with the same name, used to access a private member. One method is public and const qualified, the other is private and non-const (used by a friend class to modify the member by way of return-by-reference). Unfortunately, I am receiving compiling errors (using g++ 4.3): When using a non-co...

What is the difference between memmove and memcpy?

What is the difference between memmove and memcpy? Which one do you usually use and how? ...

RTSP client in android

I am writing a RTSP client in Android. I am able to receive the Responses for all the requests i.e., DESCRIBE it sends back the 200 OK SETUP with transport: RTP/AVP:unicast:client_port=4568:4569 got the 200 OK Message back Sent PLAY, and got the OK Message After that how to get the audio and video frames? I have searched on blogs, b...

Create thumbnails in C++

Wondering if anyone knows how to create thumbnails in C++ from NITF 2.1 images ...

How to enclose the path stored in a variable in quotes??

Hi Let us have a path C:\Program Files\TestFolder this path i got programatically and stored in a varible dirpath(for example) Now i have concatinated string dirpath=getInstallationpath()+"\\ test.dll /codebase /tlb"; then dirpath is become C:\Program Files\TestFolder\test.dll /codebase /tlb But my problem is i have make the p...

Dots in Variables? VC9 gives parsing errors when building beecrypt

Hi, I want to compile the beecrypt library under VS2008. But several of the below structures produce a syntax error (C2059 syntax error: '.'): const hashFunction md5 = { .name = "MD5", .paramsize = sizeof(md5Param), .blocksize = 64, .digestsize = 16, .reset = (hashFunctionReset) md5Reset, .update = (hashFunctionUpdate) md5Update, .diges...

Is it possible to implement a recursive Algorithm with an Iterator?

Hi there I have given a tree like this: i can acces each node with the next operator. // postorder dfs Iterator< Index<String<char> >, BottomUp<> >::Type myIterator(myIndex); for (; !atEnd(myIterator); goNext(myIterator)) // do something with myIterator but i want to use a recursive algorithm on the tree. Is there a way i can ...

"C subset of C++" -> Where not ? examples ?

I read in a lot of books the claim that "C is a subset of C++". Actually some (good?) books say: "C is a subset of C++ except the little Details". I am interested what these details are. I've never seen one. ...

When can I say that I "know" C++?

Possible Duplicate: What exactly constitutes “a working knowledge of c++”? I've been meaning to move on to something else the next few months (like data structures and algorithms but the problem is my math is still very bad) and I'm currently learning C++ on my own. So before moving on, I want to make sure that I've learned th...

When doing a parallel search, when will memory bandwidth become the limiting factor?

I have some large files (from several gigabytes to hundreds of gigabytes) that I'm searching and trying to find every occurrence of a given string. I've been looking into making this operate in parallel and have some questions. How should I be doing this? I can't copy the entire file into memory since its too big. Will multiple FILE* ...

How do I reference one VC++ project from another in the same project?

Hi, I am new to Visual Studio. Need your help with the following. Visual Studio 2005, VC++ 1 solution has 2 projects. Lets call the solution as 'solution' Project 1 is named 'p1' and project 2 is called 'p2' Do I need to export functions and classes from 'p1' so that I can use them by importing in 'p2'? What if I simply include the head...

How do I see if another process is running on windows?

I have a VC++ console app and I need to check to see if another process is running. I don't have the window title, all I have is the executable name. How do I get the process handle / PID for it? Can I enumerate the processes running with this .exe ? ...

C++ syntax question

I need help with a c++ syntax issue I'm having. #include <iostream> #include <vector> #include <string> #include <cmath> #include <fstream> #include <stdlib.h> #define RANGE 15.0 #define NUMBINS 15 struct _freq { float ini, end; int q; }; typedef _freq freq; vector<freq> alphaCutoffSelector(vector<atom> A,string _i,string _...