I'm going to write a program that plots data from a sensor connected to the computer. The sensor value is going to be plotted as a function of the time (sensor value on the y-axis, time on the x-axis). I want to be able to add new values to the plot in real time. What would be best to do this with in C++?
Edit: And by the way, the progr...
I have seen the post where somebody commented that cooliris
can be built using C++ and openGL. I have just started learning openGL.
I wanted to ask how to go about creating it?
...
Hi guys,
My environment is XP 32-bit. I find when allocated memory is nearly the maximum size, 2GB, that means a little virtual space is available, allocationnew memory is very slow.
So if I have a page file, my app need to analyze them.
I have two ways. One is to read them all into system memory, then do the analysis.
The other is to...
I have an MFC application which I am trying to package for deployment. It seems to depend on the files 'msvcr90.dll', 'msvcp90.dll' and 'mfc90.dll'. What is the correct way to distribute these files?
I can't use merge modules as my installer doesn't support them.
I know I can run VCRedist_x86.exe, but I don't want to do this for various...
is there a way to use the a.vim plugin to switch between .h, .cxx and .txx files? Alternatively, can you provide another solution? The idea is to automagically switch from .h -> .txx -> .cxx at the press of a key.
A Big Thanks to both of you!
...
It might be a silly question but is there any difference between
std::string s1("foo");
and
std::string s2 = "foo";
?
...
Is the following piece of code supposed to work?
bool b1 = true;
bool b2 = 1 < 2;
if (b1 == b2)
{
// do something
}
I suspect that not all 'trues' are equal.
...
I recently had the following memory bug, which is easy to spot here, but can be harder to detect in more complex code:
class Foo : public IFoo {
const Bar& bar_;
public:
Foo(const Bar& bar) : bar_(bar) {
}
void test() {
// access bar_ here
}
};
int baz() {
IFoo* foo = NULL;
if(whatever) {
Bar bar;
foo = new Fo...
Hi.
What is the difference between remove and unlink functions in C++?
Thanks.
...
Hi all,
I would like to decrypt a file that I previously encrypted with C# using the TripleDESCryptoServiceProvider.
Here's my code for encrypting:
private static void EncryptData(MemoryStream streamToEncrypt)
{
// initialize the encryption algorithm
TripleDES algorithm = new TripleDESCryptoServiceProvider();
...
Can I check the page fault time or something else.. :)
...
__FILE__ and __LINE__ are well known. There is a __func__ since C99.
#include <iostream>
struct Foo {
void Do(){ std::cout << __func__ << std::endl; }
};
int main()
{
std::cout << __func__ << std::endl;
Foo foo; foo.Do();
return 0;
}
will output
main
Do
Is there any macro / keyword that would output...
We have a C++ unmanaged application that appears to cause a UAC prompt. It seems to happen on Win7 and NOT on Vista
Unfortunately the UAC dlg is system modal so I can't attach a debugger to check in the code where it is, and running under msdev (we're using 2008) runs in elevated mode.
We put a message box at the start of our progr...
I frequently work with libraries that use char when working with bytes in C++. The alternative is to define a "Byte" as unsigned char but that not the standard they decided to use. I frequently pass bytes from C# into the C++ dlls and cast them to char to work with the library.
When casting ints to chars or chars to other simple types w...
I made this implementation for this problem :
http://www.spoj.pl/problems/SHOP/
#include<iostream>
#include<stdio.h>
#include<queue>
#include<conio.h>
#include<string.h>
using namespace std;
struct node
{
int x;
int y;
int time;
};
bool operator <(const node &s,const node &r)
{
if(s.time>r.time)
return true;
e...
Possible Duplicates:
Hashtable in C++?
can anybody offer a simple hash_map example in C++?
Does the STL contain an implementation of a hashtable?
If so, can you provide a brief example of how to use it?
...
There's simple example:
#include <vector>
int main() {
vector<int> veci;
vector<double> vecd;
for(int i = 0;i<10;++i){
veci.push_back(i);
vecd.push_back(i);
}
vecd = veci; // <- THE PROBLEM
}
The thing I need to know is how to overload operator = so that I could make assignment like this:
vector<double> = vector<int>;
I'...
I have an interesting problem. Let's say that i have file with lines filled like this:
name1[xp,y,z321](a,b,c){text};//comment
#comment
name2(aaaa);
also I have (simplified) class:
class something {
public:
something(const std::string& name);
addOptionalParam(const std::string& value);
addMandatoryParam(const std::string& value);
...
I am creating a constructor that will take a pair of input iterators. I want the method signature to have compile-time const semantics similar to:
DataObject::DataObject(const char *begin, const char *end)
However, I can't find any examples of this.
For example, my STL implementation's range constructor for vector is defined as:
tem...
Can I assume a file generated with fwrite and read using fread is portable across different systems. 32bit/64bit windows,osx,linux.
//dumping
FILE *of =fopen("dumped.bin","w");
double *var=new double[10];
fwrite(var, sizeof(double), 10,FILE);
//reading
file *fo=fopen()
double *var=new double[10];
fread(var,sizeof(double),10,of);
And w...