Hi,
sorry for my bad english :D
I have this piece of code:
TShape* T[256];
/* Other code ... */
for (int i = 255; i > 0; i--) {
T[i]->Brush->Color = T[i - 1]->Brush->Color;
T[i]->Pen->Color = T[i - 1]->Pen->Color;
};
The cycle is executed by a TTimer each 100 milliseconds and the Color of the first TShape change each 100...
I wish to securely delete (not even a trace in memory) anything that user types into a textbox. I wonder if setting it to "" is secure enough.
SetWindowText is a function in Win32 API, in user32.dll.
In the program:
SetWindowText(myHandle, "Hello");
SetWindowText(myHandle, "Goodbye");
//Was the buffer containing chars "Hello" overwrit...
I have the following command which works fine on Linux Console. But to get the result to a cpp file I have to store it to file and then read it. But is there a way I can directly execute this command in C++.
/usr/bin/sqlite3 /etc/myDB/db/share.db "select path from folder_info where ftp='YES'"
...
I have vector<unsigned char> filed with binary data. I need to take, lets say, 2 items from vector(2 bytes) and convert it to integer. How this could be done not in C style?
...
Why are function arguments pushed on the stack in right to left order?
...
In a game that I mod for they recently made some changes which broke a specific entity. After speaking with someone who figured out a fix for it, they only information they gave me was that they "patched it" and wouldn't share anymore.
I am basically trying to remember how to dump the memory contents of a class object at runtime. I vagu...
Hello,
I know the program name is passed as the first argument, and next simple example will print it to the standard output :
#include <iostream>
int main ( int argc, char *argv[] )
{
std::cout<<argv[0]<<std::endl;
}
Is there a function to get the program name?
EDIT
I am starting the program from the shell, and the above code wi...
I have the following in a for loop and the compiler says 'operator = is ambiguous'. Not sure how to solve this issue, can anyone help?
rootelement = document->getDocumentElement();
boost::interprocess::unique_ptr<DOMNodeIterator, release_deleter> itera (document->createNodeIterator(rootelement, DOMNodeFilter::SHOW_ALL, NULL, true))...
i would like someone to assist in converting this code to C++
c ----------------------------------------------------------------------
c Calculate pressure based on the generalized Peng-Robinson equation of state.
c for water.
c Variables Used ...
c T ... temperature (K)
c P ... vapor pressure (MPa)
c V ... volume (m^3/kmol)
c ---...
I have a 2d array matrix[10][10] that I'd like to inspect at debug time.
I understand that I can do this in GDB using
p *matrix@10
But it outputs this in one line, making it difficult to read.
Is there a way to have this output formatted in any way, lets say as a matrix?
...
Hi,
I have an abstract base class with two inherited classes. In both these classes I define a virtual method that is used by the constructor. Now I need to create a copy constructor, but I can not declare the copy constructor as virtual, but I want the method call inside it to be dependent on the type of object that is fed as argument....
Hello,
The following code:
foo.h
#include "bar.h"
class foo{
public:
enum my_enum_type { ONE, TWO, THREE };
foo();
~foo() {}
};
foo.cpp
foo::foo()
{
int i = bar::MY_DEFINE;
}
bar.h
#include "foo.h"
class bar{
public:
static const int MY_DEFINE = 10;
foo::my_enum_type var;
bar() {};
~bar() {};
};
Mak...
Hi all. I'm trying to overload the + operator in a forest class, a forest being a collection of trees, and the + operator is supposed to combine two forests into one. I have the following code as my class definition:
template<typename NODETYPE>
class Forest
{
public:
friend Forest& operator+<>(Forest&, Forest&);
...
I wonder what languages are used in robots and electronics. Is it low level languages like Java, C, C++ etc?
And if these robots and electronics could be controlled from another place, what protocol is used?
It couldn't be HTTP Rest, could it? :)
...
Why RWTime is giving 1 hour more
#include <rw/rwtime.h>
#include <rw/rwdate.h>
#include <rw/rstream.h>
main(){
RWTime t; // Current time
RWTime d(RWTime::beginDST(1990, RWZone::local()));
cout << "Current time: " << RWDate(t) << " " << t <<
endl;
cout << "Start of DST, 1990: " << RWDate(d) << " " << d <<...
I have a for loop that iterates through an XML document and finds a specified attribute, the pointer that points to the current node sits inside a boost::interprocess::unique_ptr and has a custom deletor to call the object's release() function. It seems that on every loop iteration the pointer gets deleted, but the release() function th...
Hi, are there any good solution for microtransactions/payments available to C++? Either a library or an JSON/HTTP api. I want to be able to allow payments with credit card, paypal and if possible, SMS and phone calls.
Do you know of anything that fit's my needs?
...
I have to use InMemory.db in my project but the performance is slow the InMemory.db size is 10 MB. Some queries which retrives more than 30000 records take a lot of time. Is their any way i can improve the performance.
How to make InMemory.db a Memory mapped file and use it as database in MFC. An example will be very helpfull?
...
Duplicate issue: I have read this thread and this thread and these didn't quite answer my question.
Question:: Is there a way I could make Visual Studio use g++ or comeau or other as the C++ compiler. If
so, has anyone tried it? Any feedback?
Reason: Love microsoft's IDE, hate their compiler.
...
I want to have a C preprocessor macro that knows the number of instantiations/macro calls of this macro so far.
Example:
int main() {
printf("%d\n", MACRO());
printf("%d\n", MACRO());
}
Should print
0
1
Is something like this possible?
Note that it is not enough to forward this to a function as proposed below.
It should work i...