This is a totally hypothetical question, but I have to know the answer.
I assume most C++ compilers are written in assembly. Which makes them different languages entirely (I could be wrong). That being said if I were going to create a cout style function for plain old C, how would I do it? cout has some very impressive features take thi...
Is there a way to Install Libboost 1.38 on Ubuntu 8.10? The highest version in my repositories is 1.35. It has been suggested that there may be some repositories I could add to accomplish this, but my searches haven't yielded anything.
Do I have to resort to source code? If so, what is the best way to accomplish this?
Thanks
...
Hi Everyone!
I have .wav files that have been stored in a central database. I need to play them in Mac C++ code. The .wav files have lots of different formats - some of them are quite old - for example 4bit.
I got code using AudioHardware interfaces to work for the main formats. But, these work only if the sample rate in the .wav...
Hi All,
Was just wondering how I would go about creating a planar shadow from a 4x3 matrix, all online demos I've seen use 4x4 matrices instead.
...
I have the following function in C++ managed (ref) class:
public static void Transform(Bitmap^ img);
I want to call it from C# managed code. What I do is this:
Bitmap image = new Bitmap(100, 100);
MyClass.Transform(image);
Is this correct, or do I need to use fixed statement? If so, then how?
Thank you.
...
I have a VC++ application that uses WinInet. It does the following:
calls LoadLibrary() to load WinInet.dll
calls InternetAttemptConnect()
calls InternetOpen()
calls InternetConnect() providing INTERNET_SERVICE_FTP as dwService
If the last call fails (usually because of wrong password passed) InternetConnect() returns 0 and this shou...
In short: how can I execute a+b such that any loss-of-precision due to truncation is away from zero rather than toward zero?
The Long Story
I'm computing the sum of a long series of floating point values for the purpose of computing the sample mean and variance of the set. Since Var(X) = E(X2) - E(X)2, it suffices to maintain running ...
Once in a while, I find myself rounding some numbers, and I always have to cast the result to an integer :
int rounded = (int) floor(value);
Why do all rounding functions (ceil(), floor()) return a floating number, and not an integer ? I find this pretty non-intuitive, and would love to have some explanations !
...
I'm trying to explicitly link with a DLL. No other resources is available except the DLL file itself and some documentation about the classes and its member functions.
From the documentation, each class comes with its own
member typedef
example: typedef std::map<std::string,std::string> Server::KeyValueMap, typedef std::vector<std::...
I have a visual C++ application that uses a CView derived class to render its display, which is primarily 3d vector data and true type text. The mapping mode used is either MM_ANISOTROPIC or MM_LOMETRIC. I can't use MM_TEXT as I use the same code for printing and plotting of the data and also have to overcome non-square screen pixel is...
I was a little surprised that the following code did not work as expected:
#include "stdio.h"
class RetA
{
public:
virtual void PrintMe () { printf ("Return class A\n"); }
};
class A
{
public:
virtual RetA GetValue () { return RetA (); }
};
class RetB : public RetA
{
public:
virtual void PrintMe () { printf ("Return class...
After asking my previous question about Uniscribe glyph kerning, and not yet receiving an answer, plus further reading on google etc, it seems Uniscribe may not support extracting glyph kerning information from a font.
I therefore have a simple followup question - are there any good examples (preferably with some C++ code) of extracting...
In my C++ code I have a class Foo with many methods taking a Bar type variable as an argument:
class Foo {
public:
void do_this(Bar b);
void do_that(Bar b);
/* ... */
};
Bar has a number of constructors that create a new object from many common types such as int, std::string, float, etc:
class Bar {
public:
Bar(int i);
Bar(...
Hi
I have a very simple class that looks as follows:
class CHeader
{
public:
CHeader();
~CHeader();
void SetCommand( const unsigned char cmd );
void SetFlag( const unsigned char flag );
public:
unsigned char iHeader[32];
};
void CHeader::SetCommand( const unsigned char cmd )
{
iHeader[0] = cmd;
}
void CHeader::SetFl...
Where can I see all the available methods in std library ? Since, I can include vector,algorithm in my program, can I see header/source files for this library to see how it is implemented ?
eg. I know we can use push_back() method in vector, but where can I see all the methods for vector, and similarly for others library ?
Is there an...
I have a template function where the template parameter is an integer. In my program I need to call the function with a small integer that is determined at run time. By hand I can make a table, for example:
void (*f_table[3])(void) = {f<0>,f<1>,f<2>};
and call my function with
f_table[i]();
Now, the question is if there is some aut...
I am programing under C++, MFC, windows.
I want to delete a folder into recycle bin.
How can I do this?
CString filePath = directorytoBeDeletePath;
TCHAR ToBuf[MAX_PATH + 10];
TCHAR FromBuf[MAX_PATH + 10];
ZeroMemory(ToBuf, sizeof(ToBuf));
ZeroMemory(FromBuf, sizeof(FromBuf));
lstrcpy(FromBuf, filePath);
SHFILEOPSTRUCT FileOp;...
I was trying to get a Uuid via NtAllocateUuids or simply calling UuidCreateSequential,
but Windows wasn't able to get an Ethernet or token-ring hardware address for my laptop.
And so, when the system is booting, windows sets the UuidSeed to a random number instead of a given MAC.
--> uniqueness is guaranteed only until the system is next...
How can a hexadecimal floating point constant, as specified in C99, be printed from a array of bytes representing the machine representation of a floating point value? e.g. given
union u_double
{
double dbl;
char data[sizeof(double)];
};
An example hexadecimal floating point constant is a string of the form
0x1.FFFFFEp1...
hi can anyone suggest me where ro download a GNU c++ compiler, which i can use in ubuntu and also on windows with Netbeans IDE. and also GNU tools.
...