c++

What is a good resource to learn Chai3D?

Apart from the documentation, is there any good source to earn Chai3D coding using C++? I searched on the internet for some tutorials, but could not find anything. Do you know of some good place to learn programming for Chai3D? ...

C++ fast division/mod by 10^x

Hi All In my program I am using a lot of integer division by 10^x and integer mod function of power 10. ex: unsigned __int64 a = 12345; a = a / 100; .... or unsigned __int64 a = 12345; a = a % 1000; .... If i am going to use bite shift >> , then i will get mode of 2^x, which is not what i want. Is there any way, I can speed up m...

Creating libraries for Arduino

I want to write a library for my Arduino(header and class files), but I don't know what tools to use for this job and how to test and debug them. The Arduino IDE just helps in writing plain programs for direct bootloading, not full project management thing (correct me if I am wrong and guide appropriately with relevant references). Ple...

Looking for a permissive and active cross-platform image processing library in C/C++

I'm looking a cross-platform image processing library in C/C++ which is under active development. One more requirement: No GPL license. Some references: http://stackoverflow.com/questions/796364/fast-cross-platform-c-c-image-processing-libraries http://stackoverflow.com/questions/1200727/cross-platform-drawing-library ...

C++ What using for lexicographical_compare?

I wan to user the function lexicographical_compare in algorithms library in c++. But I do not know what to write as far as the using statement. For example using std::lexicographical_compare ?? How can I figure this out for my self in the future? Thanks ...

How to sort filenames with possibly unpadded numbers in c++?

I need to sort filenames that can have a common root, but are then followed by numbers that are not necessarily padded uniformely; one example is what you obtain when you rename multiple files in Windows. filenamea (1).txt filenamea (2).txt ... filenamea (10).txt ... filenamea (100).txt ... filenameb.txt ... filenamec (1).txt filenamec ...

regarding receiving sms using symbian c++

hi can we recieve the msges tat are comin to the inbox? i want the msges to be transfered to the bluetooth to another device in the automobiles? please tel me any solution. ...

Linker error when compiling boost.asio example

I am trying to compile a boost.asio example, but I get the following linker errors: "undefined reference to _Unwind_Resume'" and "undefined reference to__gxx_personality_v0'". I've been searching google for a long time, but nothing helped. Which library do I need to link? Thanks in advance! ...

MinGW linker error: winsock

Hello, I am using MinGW compiler on Windows to compile my C++ application with sockets. My command for linking looks like: g++.exe -Wall -Wno-long-long -pedantic -lwsock32 -o dist/Windows/piskvorky { there are a lot of object files } and I have also tried g++.exe -Wall -Wno-long-long -pedantic -lws2_32 -o dist/Windows/piskvorky...

Override IP in HTTP Request

Looking for a way to issue an HTTPwebrequest, or use the browser control, or winhttp to make a request to a URL, but override the IP address it connects to from the DNS lookup to a specific one. Trying to do something similar to the HOSTS file, but programatically without having to modify this file. It can be C# or C+ Why I need it, t...

i cant link my opengl program to math3d.h

Hey, I was writing an opengl program and it happens that i have a problem with linking with math3d.h. I am using ubuntu and g++. The thing is that i dint install the package for the math3d coz i got the header file and a cpp file from the net with opengl superbible. So i just copied the header file and .cpp file to the local directo...

I'm using Crypto++ for RSA encryption. My plain text exceeds FixedMaxPlaintextLength. What should I do?

Should I break the text into chunks? Is RSA the wrong encryption scheme? ...

Cross-platform redirect of standard input and output of spawned process in native C/C++ (edit with solution)

Hello, I have a string command I'd like to execute asynchronously while writing to its input and reading its output. Sounds easy, right, the devil is in the cross-platform. I'm targeting both MSVC/Win32 and gcc/Linux and obviously want to write the minimum amount of platform-specific code. My google-fu has failed me, I get too much nois...

Algorithm to find palindromes

I'm posting this on behalf of a friend since I believe this is pretty interesting: Take the string "abb". By leaving out any number of letters less than the length of the string we end up with 7 strings. a b b ab ab bb abb Out of these 4 are palindromes. Similarly for the string "hihellolookhavealookatthispa...

How do you determine full paths from filename command line arguments in a c++ program?

I am writing a program in c++ that accepts a filename as an argument on the command line: >> ./myprogram ../path/to/file.txt I know I can simply open an fstream using argv[1], but the program needs more information about the exact location (ie. full pathname) of the file. I thought about appending argv[1] to getcwd(), however obvious...

Howto compile for Windows on Linux with gcc / g++ ?

Dear developers, I have written some effects in C++ (g++) using freeglut on Linux, and I compile them with g++ -Wall -lglut part8.cpp -o part8 So I was wondering if it is possible to have g++ make static compiled Windows executables that contains everything needed? I don't have Windows, so it would be really cool, if I could do that...

size of dynamically allocated array

Hi, Is it true that a pointer assigned to the starting address of a dynamically allocated array does not have the information of the size of the array? So we have to use another variable to store its size for later processing the array through the pointer. But when we free the dynamically allocated array, we don't specify the size, ins...

How to make exe in Qt?

Hi, I'm starting to learn Qt and I'm stuck on particular step, which is: I cannot create executable file. My steps are as follows: Creation of *.cpp In console typing qmake -project (this creates .pro file) In console typing qmake -makefile (now I have makefile + some other files) I'm trying to create .exe by typing qmake but this isn'...

explicit copy constructor or implicit parameter by value

I recently read (and unfortunately forgot where), that the best way to write operator= is like this: foo &operator=(foo other) { swap(*this, other); return *this; } instead of this: foo &operator=(const foo &other) { foo copy(other); swap(*this, copy); return *this; } The idea is that if operator= is called with...

linked-list in C++ how to go to "next element" using STL list

I have a very basic question. I want to use STL's list instead of creating my own linked-list ( my code is shown below) struct myList { myList *next; myList *previous; }; myList->next = NULL; Using STL list: #include <list> std::list<int> L; L.push_back(1); My question is, how to access the "next" element in STL's list? ...