I am drawing a little graphical display that is expensive to calculate. So I wish to draw the picture into a pixmap, retaining the pixmap and using that pixmap to refresh the drawing area when the drawing area gets expose events.
First of all, is that a reasonable procedure or pointless over-engineering?
If it is reasonable, then I nee...
Could somebody be kind to explain why in the world this gives me a segmentation fault error?
#include <vector>
#include <iostream>
using namespace std;
vector <double>freqnote;
int main(){
freqnote[0] = 16.35;
cout << freqnote[0];
return 0;
}
I had other vectors in the code and this is the only vector that seems to be giving me ...
I am writing a client server application using boost::asio. I want to transfer a structure from a client to the server. The struct has a few std::wstrings in it. How do I encode the structure in boost::asio::buffer?
...
$5.7 -
"[..]For addition, either both operands shall have arithmetic or enumeration type, or one operand shall be a pointer to a completely defined object type and the other shall have integral or enumeration type.
2 For subtraction, one of the following shall hold:
— both operands have arithmetic or enumeration type; or
— both operand...
Hello!
I want to ask what happen, when I use virtual functions without pointers ? for example:
#include <iostream>
using namespace std;
class Parent
{
public:
Parent(int i) { }
virtual void f() { cout<<"Parent"<<endl; }
};
class Child : public Parent
{
public:
Child(int i) : Parent(i) { }
virtual void f() { Parent::f(); c...
Hello
I was trying to compile a simple Helloworld program for BADA but through command prompt.After compiling i ma getting the errors as
c:/Helloworld/src/Helloworld.cpp:12: error: prototype for 'Osp::App::Application HelloWorld::CreateInstance()' does not match any in class 'HelloWorld'
C:/Helloworld/inc/HelloWorld.h:21: error: candida...
Hi,
What kind of stream can cause to function run forever ?
Is such stream exist ?
...
Dear all;
I need to design (and code, at some point) a "customized" string class in C++. I was wondering if you could please let me know about any documentation and design issues, primarily, and potential pitfalls I should be aware of. Links are very welcome, as are the identification of problems (if any) with current string libs (Qstri...
Hi All,
I have a code of about 10,000 lines. I have to maintain a track for new and delete statements to check and avoid memory leaks. i can use new libraries or functions but i can't change the code. How can i do it? Please donot suggest for any memory cheking tool.
Any help would be appreciated.
...
Do you know if there is a tool in Windows that is able to start a C++ application and, when there is an exception, is able to automatically save to file the stack trace information?
I now that there is the dbghelp.dll and StackWalk64 function but I would like rather to use some tool instead of coding myself.
Right now I am also looki...
I'm using an isapi filter to redirect request for http://testportal.com/sites/testsp/_layouts/AccessDenied.aspx to a message page i've placed at the root of the site called "/test_msg.aspx."
The filter works, if I set the filter to capture request going to "sites/testsp/_layouts/"
but when i set it to "sites/testsp/_layouts/AccessDenied...
Hi,
I have below piece of code
class Test
{
public:
Test(){}
Test(int i) {}
void* operator new (size_t size)
{
void *p = malloc(size);
return p;
}
//void* operator new (size_t size, Test *p)
//{
// return p;
//}
};
int main() {
Test *p = new Test;
int i = 10;
new(p) Test(i);
}
Above p...
Our codebase has thousands of lines and legacy code. Across time different developers have coded as per their suitability and standards. One of the wrongly implemented code is that a common header is included is declared and defined in different directories to be lined to different binaries with little difference. Ex:
dir1/xxx.h
class ...
Hi,
I do have say #if A in code and made a lib.
Now for some reason i do want to take out code from lib containing #if A without recompiling the lib.
Can i do this using some command.
Regards,
Kiran
...
Hi all,
i'm supposed to write code which when given a text file (source code) as input will output which programming language is it. This is the most basic definition of the problem. More constraints follow:
I must write this in C++.
A wide variety of languages should be recognized - html, php, perl, ruby, C, C++, Java, C#...
Amount o...
Hello,
I was trying to figure out if it is possible to use sfinae to test namespace member existence.
Google is rather silent about it. I've tried the following code, but it fails.
namespace xyz{
struct abc{};
}
struct abc{};
struct test_xyz{
typedef char yes;
typedef struct{ char a[2]; } no;
template <class C> static yes test(...
here is code in which i am trying implement queue using linked list code
#include <iostream>
#include <cstdlib>
using namespace std;
template <class Item>
class Queue{
public:
struct node{
Item item;node *next;
node (Item x){
item=x; next=0;
}
};
typedef node* link;
link hea...
Hi there,
I'm looking for a NoSQL-way to store machinedata like information about tools, work pieces, products, operations and so on... Currently I'm concentrating on BerkeleyDB and need input from you guys, whether I should consider using another nosql-database which might fit better on my requierements. Data stored in this db should b...
Quoting "The C++ programming language" (special edition, section 4.9.6, "Objects and Lvalues"), and as is well known:
[...] an object declared in a function is created when its definition is encountered and destroyed when its name goes out of scope
OK ! And in section 4.9.4:
A name can be used only in specific part of the progr...
hello,
#include <string>
#include <iostream>
#include <sstream>
#include <curl/curl.h>
#include <htmlcxx/html/ParserDom.h>
#include <iostream>
using namespace std;
using namespace htmlcxx;
static size_t http_write(void* buf, size_t size, size_t nmemb, void* userp)
{
if(userp)
{
ostringstream* oss = static_cast<o...