I want to print out a function pointer using cout, and found it did not work.
But it worked after I converting the function pointer to (void *), so does printf with %p, such as
#include <iostream>
using namespace std;
int foo() {return 0;}
int main()
{
int (*pf)();
pf = foo;
cout << "cout << pf is " << pf << endl;
cou...
Is it possible to link to non-external symbols, or convert them to external symbols?
I only ask because a (big) library I want to use has a nightly build, but with stripped symbols. I'd prefer to use the nightly, rather than spend half a day compiling it.
...
i need to compile ffmpeg (64 bit shared dll) for windows.
however I configure in mingw, it always produces 32 bit binary for me.
tried this already
./configure --enable-shared --disable-static --enable-memalign-hack --arch=amd64
./configure --enable-shared --disable-static --enable-memalign-hack --arch=x86_64
my guess is that a x86 t...
Is this really the only way to get the correct address for an instance function:
typedef CBitmap * (CDC::* SelectObjectBitmap)(CBitmap*);
SelectObjectBitmap pmf = (SelectObjectBitmap)&CDC::SelectObject;
First, one has to create a typedef, and then one has to use that to force the compiler to select the correct overloaded method when t...
Hello!
Need to log the content of buf using the LogMethod() below the problem is that
LogMethos only accepts a "Const CString&"
char buf[1024];
strcpy(buf, cErrorMsg);
// need to pass to LogMethod "buf" how do i do that?
log.LogMethod(const CString &);
Thans
Rev
Reversed
...
I am trying to get input from the user and need to know a way to have the program recognize that the input was or was not a double/char this is what i have right now... but when you type an incorrect type of input
1) the double test one just loops infinatly
2) the char one won't stop looping even with the correct imput
int m...
I'm in the process of developing a software library to be used for embedded systems like an ARM chip or a TI DSP (for mostly embedded systems, but it would also be nice if it could also be used in a PC environment). Obviously this is a pretty broad range of target systems, so being able to easily port to different systems is a priority....
Do we need a virtual destructor if my classes do not allocate any memory dynamically ?
e.g.
class A
{
private:
int a;
int b;
public:
A();
~A();
};
class B: public A
{
private:
int c;
int d;
public:
B();
~B();
};
In this case do we need to mark A's destru...
I wanted to plot the wave-form of the .wav file for the specific plotting width.
Which method should I use to display correct waveform plot ?
Any Suggestions , tutorial , links are welcomed....
...
Does anyone know how I can print and count what I printed?
Say I have a number I am printing via printf or cout. How could I count the actual number of digits I have printed out?
Gracias
...
Inside the constructor of a Form when I am stepping through my code, a method declared in the very same form is called. Before I can step inside the method, I get a System.IO.FileNotFoundException with message "The specified module could not be found. (Exception from HRESULT: 0x8007007E)". The member method I try to enter is declared u...
Hello, could anyone tell me or point me to a simple example of how to append an int to a stringstream containing the word "Something" (or any word)?
Thanks!
...
In my C++ program, I want to be able to add some text over an image. I can already load/save the image, I just need to add text to it.
I want to be able to use different fonts, colors, italics, bold, solid/transparent background, have a border around the letters, etc.
I've done this in the past by using the old MFC functions to genera...
I'm profiling some computationally intensive code of mine, and was surprised to see that the function RtlpNtMakeTemporaryKey takes up a huge chunk of time. It's module is ntdll and the source file is Unknown. Is this a call which is waiting for my slow function to terminate or is it something which I can optimize?
...
Hello,
I am using NetBeans 6.8 on Redhat Linux. Does anyone know how to configure NetBeans to debug (step into) libraries not compiled with NetBeans? In my particular case, I'm trying to debug the VTK library which is built using cmake with the Debug flag set. I've written a C++ application that uses the shared libraries from VTK. A...
I write a simple program, to run in DOS mode. Everything works under emulated console in Win XP / Vista / Seven, but not in DOS. The error says: this program caonnot be run in DOS mode. I wonder is that a problem with compiler flags or something bigger.
For programming i use Code::Blocks v 8.02 with such settings for compilation:
-Wall...
I have confusion about the concept of inheritance in C++, suppose we have a class named computer and we publicly inherit a class named laptop from computer class. Now when we create an object of class laptop in main function what happens in the memory? Please Explain.
...
I have a C# implementation of a C++ COM Interface. I have ported the IDL (Interface) as accurately as I can.
When the C++ app instantiates my object it successfully calls one of the methods. It then tries to call another of the methods but nothing happens. The second call's execution path never makes it to the C# side.
I don't have ac...
I have the following code to render text in my app, first i get the mouse coordinates in the world, then use those coordinates to place my text in the world, so it will follow my mouse position:
Edit: added buildfont() function in code example:
GLvoid BuildFont(GLvoid) // Build Our Bitmap Font
{
HFONT...
Hello:
I have this simple code that needs to get a chunk of a large log file that is being written into. At some point it stores the current location returned from
streampos start = istream::tellg();
method.
Later on the code has to read from the stream a buffer from the start till the end. The code is approximately like this:
streamp...