I have a DLL that is written in C++ and I want to suppress the name mangling for a few exported methods. The methods are global and are not members of any class. Is there a way to achieve this?
BTW: I'm using VS2008.
...
I am interested to learn about the binary format for a single or a double type used by C++ on Intel based systems.
I have avoided the use of floating point numbers in cases where the data needs to potentially be read or written by another system (i.e. files or networking). I do realise that I could use fixed point numbers instead, and ...
This compiles:
int* p1;
const int* p2;
p2 = p1;
This does not:
vector<int*> v1;
vector<const int*> v2;
v2 = v1; // Error!
v2 = static_cast<vector<const int*> >(v1); // Error!
What are the type equivalence rules for nested const pointers? I thought the conversion would be implicit. Besides, I'd rather not implement point-wise as...
Hi,
in my multithraded application, I'm using a sleep() function (the one from the GLFW library):
glfwSleep(..);
and it apparently leads my application to segfaulting as my call stack shows:
#0 76CFC2BC WaitForSingleObjectEx() (C:\Windows\system32\kernel32.dll:??)
#1 00000016 ??() (??:??)
#2 0000006C ??() (??:??)
#3 00000000 ??() (...
Possible Duplicates:
Valid use of goto for error management in C?
Examples of good gotos in C or C++
GOTO still considered harmful?
To Use GOTO or Not?
The goto statement seems very risky to use. When would it be a good scenario to use a goto statement instead of nesting control statements? Is it even a preferred way of ...
I've been dealing with this problem for my thesis.
The goal is to develop a .net server monitoring tool specifically for windows 2K8 servers.
So far, all I can access are software performance counters. Meaning those that are available through perfmon and the WMI classes.
But then there's also the issue that I need to be able to monitor ...
And I know there's std::cin, but that requires the user to enter a string, then press ENTER. Is there a way to simply get the next key that is pushed without needing to press ENTER to confirm
...
Hi,
Got some code that is not mine and its producing this warning atm:
iehtmlwin.cpp(264) : warning C4996: 'std::basic_string<_Elem,_Traits,_Ax>::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. ...
I am writing a program which will tokenize the input text depending upon some specific rules. I am using C++ for this.
Rules
Letter 'a' should be converted to token 'V-A'
Letter 'p' should be converted to token 'C-PA'
Letter 'pp' should be converted to token 'C-PPA'
Letter 'u' should be converted to token 'V-U'
This is just a sample...
I have an application that runs on a device that is not connected to the internet. The OS is Windows XP.
There're C++ module and Java module that interact over a socket. The Java part needs to get a file from the C++ part according to its date and time. When DST switch arrived they stopped working.
It seems that the C++ ignores DST becau...
This doesn't work:
string temp;
cout << "Press Enter to Continue";
cin >> temp;
...
Hello all :)
Quick question -- Why use Precompiled Headers?
Billy3
EDIT:
Reading the responses, I suspect what I've been doing with them is kinda stupid:
#pragma once
//Defines used for production versions
#ifndef PRODUCTION
#define eMsg(x) (x) //Show error messages
#define eAsciiMsg(x) (x)
#else
#define eMsg(x) (L"") //Don't show...
I have a class with a member m_preferences (a vector containing assocation between word and features).
In this class the m_preferences is not static and thus any instance of the class has its specific m_preferences.
class Base{
private:
Preferences m_preferences;
public:
...
}
I then created a derived class where m_preference...
It seems that there are several really fast prime factorization algorithms around (one that looks ideal is quadratic sieving). However, rather than make my own (likely poor) implementation I would like to use a ready-made library for simplicity.
I need to be able to factor integers of up to 15 digits efficiently. Because of that, I'm no...
I have read multiple articles about why singletons are bad.
I know it has few uses like logging but what about initalizing and deinitializing.
Are there any problems doing that?
I have a scripting engine that I need to bind on startup to a library.
Libraries don't have main() so what should I use?
Regular functions or a Singleton.
Can th...
Hey there,
I'ld like to analyze the certificate of a given url and get some details of it. Do you know any ways to do this? A command-line tool can be something like downloadSSLCert https://my.funny.url/ > certFile and then analyzing it for e.g. the fingerprint of the cert. It can be a command line utility, a c/c++/objective-c or java c...
I'm trying to build code from the nVidia 9.5 SDK but I get the following linker errors:
>1>NV_D3DCommonDX9U.lib(NV_StringFuncs.obj) : error LNK2005: "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::getline<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_istream<char,struct st...
I'm using the following code to write data through a named pipe from one application to another. The thread where the writing is taken place should never be exited. But if r_write() returns less than it should, the thread/program stops for some reason. How can I make the thread continue once write has returned less than it should?
ssize...
Why does the following code give me an error (g++ 4.1.2)?
template<class A>
class Foo {
public:
typedef std::vector<A> AVec;
AVec* foo();
};
template<class A>
Foo<A>::AVec* Foo<A>::foo() { // error on this line
return NULL;
}
The error is:
error: expected constructor, destructor, or type conversion before '*' token
How am I ...
Hi.
I'm currently using shared memory for IPC between Java and C++ apps, but looking for a more convenient alternative.
Can someone advice better method, but with same performance speed?
Thanks!
...