This is for research purpose.
I have .Net framework 2.0 installed, and I want to load mscorlib.dll 1.1 dynamiclly to execute its specific inner function.
When I wrote this code in C#:
static void Main(string[] args)
{
Assembly assem = Assembly.LoadFrom("C:\\mscorlib_my_private_1.1.dll");
System.Type type = assem...
I believe the expression T() creates an rvalue (by the Standard). However, the following code compiles (at least on gcc4.0):
class T {};
int main()
{
T() = T();
}
I know technically this is possible because member functions can be invoked on temporaries and the above is just invoking the operator= on the rvalue temporary created...
what are virtual functions? what is pure virtual function? please explain with example
...
I'm learning C++ and I am writing a function that determines whether a string contains only alphanumeric characters and spaces. I suppose I am effectively testing whether it matches the regular expression ^[[:alnum:] ]+$ but without using regular expressions. I have seen a lot of algorithms revolve around iterators, so I tried to find a ...
The code below demonstrates this difference:
#include <iostream>
#include <string>
int main()
{
char s[] = "ABCD";
std::string str(s);
char *p = s;
while(*p) {
*p++ = tolower(*p); // <-- incr after assignment
}
std::cout << s << std::endl;
std::string::i...
I'm trying to compile this code with GCC 4.5.0:
#include <algorithm>
#include <vector>
template <typename T> void sort(T, T) {}
int main()
{
std::vector<int> v;
sort(v.begin(), v.end());
}
But it doesn't seem to work:
$ g++ -c nm.cpp
nm.cpp: In function ‘int main()’:
nm.cpp:9:28: error: call of overloaded ‘sort(std::vector<...
I am trying to get the profiler plug-in for IAR Embedded Workbench for ARM to work. I have set everything in the documentation but when I fire up C-Spy and start the plug-in I get errors. I tried to different emulators and each gave a different error:
Segger SAM-ICE JTAG Emulator - The following appears in the debug log:
Thu May 27 12:...
Hi,
I want to develop a program that copies a partition's 'data' only, to another partition. And I want to do it such that the program starts from the first sector of source partition and checks if a sector is used.
If it is used
copy it to the destination parition.
Else
don't copy.
In other words it's like copying only th...
Hi there. Im trying to build a kd-tree for searching through a set of points, but am getting confused about the use of 'median' in the wikipedia article. For ease of use, the wikipedia article states the pseudo-code of kd-tree construction as:
function kdtree (list of points pointList, int depth)
{
if pointList is empty
retu...
hi all,
i want to show browser control in my application for which i have written code
if (iBrCtlInterface == NULL)
{
TRect rect(Position(), Size());
iBrCtlInterface = CreateBrowserControlL( this,
rect,
TBrCtlDefs::ECapabilityDisplayScrollBar | TBrCtlDefs::ECapabilityLoadHttpFw,
iCommandBase,
NULL,
NULL,
NULL,
NULL,
NULL);
}
_LIT...
I went through answers on similar topics here on SO but could't find a satisfying answer. Since i know this is a rather large topic, i will try to be more specific.
I want to write a program which processes files. The processing is nontrivial, so the best way is to split different phases into standalone modules which then would be used ...
Before disconnect the client, the server wants to send some info to the client - why do I(server) disconnect you(client).
If I send packet to the info and close the client socket immediately, closesocket() returns -1 and if I use linger option to work closesocket() successfully, the info cannot be sent completely.
How can I complete t...
I have a file of data Dump, in with different timestamped data available, I get the time from timestamp and sleep my c thread for that time. But the problem is that The actual time difference is 10 second and the data which I receive at the receiving end is almost 14, 15 second delay. I am using window OS. Kindly guide me.
Sorry for my...
I have a C++ DLL that imports a .tlb file generated in a C# project. The C++ DLL is a wrapper DLL containing functions that call the corresponding C# functions.
When I call the C++ functions on the computer that I built the projects, all works well. But when I copy the DLL's and generated tlb's to another computer with the same exact ve...
I recently got MySQL compiled and working on Cygwin, and got a simple test example from online to verify that it worked. The test example compiled and ran successfully.
However, when incorporating MySQL in a hobby project of mine it isn't compiling which I believe is due to how the Makefile is setup, I have no experience with Makefiles ...
I am integrating WebKit (via Qt) into an application. Instead of having WebKit retrieve scripts, CSS files and images via URLs, I want my application to provide them (e.g. retrieved from a database).
For example, a "regular" web page may contain this tag:
<IMG src="photos/album1/123456.jpg">
Instead of WebKit fetching this image fr...
Suppose I have a class that requires copy constructor to be called to make a correct copy of:
struct CWeird
{
CWeird() { number = 47; target = &number; }
CWeird(const CWeird &other) : number(other.number), target(&number) { }
const CWeird& operator=(const CWeird &w) { number = w.number; return *this; }
void output()
...
Hi,
I'd like to determine which form a given component belongs to in my application. Neither the Parent nor the Owner property can be assumed to be the form itself, so I can't simply use this.
I guess I could just go through the Parent property recursively until I arrive at something derived from TForm, but is there a better way to do ...
I have a set<string> from "one", "two", and "three".
How can I get all pairs from it?
one - two
one - three
two - three
...
hi.
this code:
boost::filesystem::is_directory("/usr/include");
work fine.
both this code:
boost::filesystem::is_directory(L"/usr/include");
throw an exception:
terminate called after throwing an
instance of 'std::runtime_error'
what():
locale::facet::_S_create_c_locale name
not valid
OS - Linux Mint
boost-1.43
gc...