Hello,i have a problem with berkeley DB.I get a dialog titled "Unable To Locate Componenent" saying "This application has failed to start because libdb48.dll was not found.Re-installing the application may fix this problem",then it crashes after clicking ok.i got the error message when running these simple code below:
#include <iostream...
I am programming in C++ more then 5 years, and have never met any place where reference of the variable is recommended to use except as a function argument (if you don't want to copy what you pass as your function argument). So could someone point cases where C++ variable reference is recommended (I mean it gives any advantage) to use.
...
I've been going over the Poco SAX parser header files a few times but I can't seem to find any info on how to obtain an element's inner text. For example:
<description>This is the inner text.</description>
Can anyone point me in the right direction?
...
#include<iostream>
#include<string>
using namespace std;
int main()
{
char arr[1000][80];
char output[1000][80];
int n,i,j;
int num[1000];
cin>>n;
for(i=0;i<n;i++)
{
cin>>num[i];
cin>>arr[i];
}
for(i=0;i<n;i++)
{
for(j=(num[i]-1);j<(strlen(arr[i])-1);j++)
{
arr[i][j]=arr[i][j+1]...
Hey stackoverflow Community!
I learned the basics of C# (i can write some Form-Applications) and now I want to learn how to write 2d games. I don't know where to start.
Is there a engine that's good for 2d games? After learning the basics of 2d I'll want to write simple games which work under windows and linux (that whould be cool, linux...
Imagine two similar pieces of code:
try {
[...]
} catch (myErr &err) {
err.append("More info added to error...");
throw err;
}
and
try {
[...]
} catch (myErr &err) {
err.append("More info added to error...");
throw;
}
Are these effectively the same or do they differ in some subtle way? For example, does the first one c...
Like it has been written here Qt up to now has 8 specilized smart pointer classes.
It looks like it is all you will ever need.
However, in order to use any of these smart pointers your class must be derived from QObject which is not always convenient.
Is there other implementations of smart pointers in Qt which work with arbitrary classe...
I am unable to delete a mp3 file from C++ using remove(), neither can rename it using rename() function. What can I do to troubleshoot this?
...
I have a template class that looks something like this:
template<class T> class C
{
void A();
void B();
// Other stuff
};
template<class T> void C<T>::A() { /* something */ }
template<class T> void C<T>::B() { /* something */ }
What I want is to provide an explicit specialization for only A while retaining the default fo...
Background
Unfortunately the current C++ standard lacks C99's exact-width types defined in the stdint header.
The next best thing I could find (in terms of portability) was Boost's cstdint.hpp implementation from the Boost.Integer library.
Concerns
That said, I've got a few problems with it:
Boost's implementation dumps all the ...
I am setting up EMACS for a C++ project on UBUNTU. I am successful so far in installing
ECB
CEDET - I got code completion and other features working.
Color theme
I am having problems with EDE package. The "Project" menu is not showing. I have added (global-ede-mode t) to the .emacs file, but no luck. Do I need to install EDE package...
This may seem a stupid question but I can't find the anwer...
This is the code for XXTEA from Wikipedia:
#include <stdint.h>
#define DELTA 0x9e3779b9
#define MX ((z>>5^y<<2) + (y>>3^z<<4)) ^ ((sum^y) + (k[(p&3)^e] ^ z));
void btea(uint32_t *v, int n, uint32_t const k[4]) {
uint32_t y, z, sum;
unsigned p, rounds, e;
if (n > 1) { ...
Hello there,
I had a problem when trying to connect and upload a file to an FTP server.
Here's my code:
#include <windows.h>
#include <wininet.h>
#pragma comment(lib, "wininet.lib")
int main()
{
HINTERNET hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
HINTERNET hFtpSession = InternetConnect(hIntern...
Studing the code in Schaum's C++ book, i saw a lot of code using char*, int* etc.
Doing the exercises i also saw that in the solutions there is char* and in my code i have used char (without the star).
I want to know what is the difference between a char and a pointer char - integer and a pointer integer ? Where should i use them ? Wh...
I have implemented tool tips seemingly successfully in an app which is MFC based and uses CPropertyPage. However after adding a button to open a dialog box called IDC_USERMSG which contains a single CEdit control on one of the CPropety pages an Assert is thrown when the IDC_USERMSG dialog is dismissed.
_AFXWIN_INLINE CWnd* CWnd::GetP...
Hello there,
I'm now creating a file transaction system (through FTP) using wxWidgets for the GUI and a multithreading class from CodeProject (http://www.codeproject.com/KB/threads/SynchronizedThreadNoMfc.aspx) - Please read the article first for reference.
In my GUI, I have a textbox (wxTextCtrl) that stores the file path that wanted ...
How does it work? Does it have distinct parts - some methods are managed, some are unmanaged, does it convert every method to managed, trying to keep everything managed and doing the interop calls when he must?
...
My code is quite simple and straightforward. I get "wrong answer" on submission though. I have no clue why that happens! Here is the code...
#include<iostream>
#include<string>
using namespace std;
void sum(string num)
{
int i,len=num.length();
int j=len-1;
int carry=0;
string answer;
int s=0;
for(i=0,j;i<len;i++,j--)
{
...
Hi
Is i have a priority queue with declaration
priority_queue<<Node>,vector<Node>,myComp> openQ
i am inserting node objects into it. but at some time i have to delete the element from it. (not to remove the top element)
Currently to delete it i am popping the element and putting it in array. if the top most element is desired then e...
I'm a little confused about what the correct way to reset or clear the data in associated with a QAbstractItemModel. I'm writing an application in which the user can "start over" with a new set of data (empty, or small).
Should I be deleting the old model when the user makes this request? Or should I leave the model alone and just remov...