Pointers-to-pointers and references-to-pointers seem overly complicated at first, especially for newbies. What is the best and most useful reason you used one in a c/c++ project you worked on?
This can help people better understand pointers and how to use them effectively.
Edited: Included C as well as C++
...
I want my C++ program to include a "--version" option which causes it to print out:
Architecture it's compiled for
Version of the source (e.g., v0.1.0)
Name of the application
I'm also using autoconf/automake for the first time, and I notice that configure.ac has both the binary and the version. It doesn't currently have architecture...
Hello I am trying to change the behavior of the windows xp ctrl alt del key in certain scenarios throught Gina. Specifically I want to unhook the custom dialog that appears on ctrl alt del that was implemented in legacy code, and have my task manager back. Would someone point me at the right direction please?
...
In various c++ code you often see different usage of strings: PWSTR, char*, std::string, CString, etc ...
When is the best time to use PWSTR as compared to any other string type?
...
Does anyone know if there is a tool or lib for creating network diagrams dynamically. Either in C++ or PHP as this will be used within a web page.
Thanks
...
I have a .NET/native C++ application. Currently, the C++ code allocates memory on the default heap which persists for the life of the application. Basically, functions/commands are executed in the C++ which results in allocation/modification of the current persistent memory. I am investigating an approach for cancelling one of these f...
From the lectures notes of a course at university, on "call-by-value":
void fun(int *ip)
{
*ip =100;
}
called by
int n=2;
int *np;
np =
fun(np);
would change the value of n to 100.
When we say "int *ip", what exactly do we mean? A pointer of type integer? If so, when we call fun() with np as its argument, shouldn...
I've came across the following code, ok, not exactly but close.
The point of interest is the second line in the (heavily abbreviated code).
Why does one have to intialize someReference 'someReference' ? Other then be able to use . operator instead of -> ?
ptrThis is just as good, no? (it's inside the thread method, if that makes any diff...
io_iterator_t enumerator;
kern_return_t result;
result = IOServiceAddMatchingNotification(
mNotifyPort,
kIOMatchedNotification,
IOServiceMatching( "IOFireWireLocalNode" ),
serviceMatchingCallback,
(void *)0x1234,
& enumerator );
serviceMatchingCallback((...
I have code which works in VC9 (Microsoft Visual C++ 2008 SP1) but not in GCC 4.2 (on Mac):
struct tag {};
template< typename T >
struct C
{
template< typename Tag >
void f( T ); // declaration only
template<>
inline void f< tag >( T ) {} // ERROR: explicit specialization in
}; ...
Every now and then, someone on SO points out that char (aka 'byte') isn't necessarily 8 bits.
It seems that 8-bit char is almost universal. I would have thought that for mainstream platforms, it is necessary to have an 8-bit char to ensure its viability in the marketplace.
Both now and historically, what platforms use a char that is no...
Hi.
Any ideas for barcode generation into a textbox in c++ under Qt4?
The idea is to have it in some kind of text format to save it and be able to read it later on.
What about generating the image for printing?
Thanks in advance.
...
I see this problem in follwing scnerio:
The activex control is created with Extent 0,0(so it is not visible in IE). Then the user clicks on a html button which has the following pseudo code:
Find the object;
Object.display = “visibile”;
In my corresponding put_display what executes is something like this:
Rect rect = //New sized posi...
I'm looking to add an element to my wxWidgets GUI that behaves like a terminal emulator. Not in terms of a shell which executes commands, but just the input-output setup of an application running in a terminal.
Basically, the requirements are:
Streaming input/output: When you enter a character, it is added to an input stream, and when...
Hi all, I understand this is a classic programming problem and therefore I want to be clear I'm not looking for code as a solution, but would appreciate a push in the right direction. I'm learning C++ and as part of the learning process I'm attempting some programming problems. I'm attempting to write a program which deals with numbers...
Nokia has a long list of short codes on Symbian that can be applied to on-device data, such as
*#0000# - to check the phones software revision type,
*#7780# - to restore factory settings,
etc (the list is long)
If given a short code, how can I launch it? The program should not be aware of the functionality of the short code, it sho...
Given this:
struct { int x; } ix;
struct A { A() {}; int x; };
A ia;
Which of these is true?
a. ix is an object
b. ia is an object
c. both are objects
d. both are not objects.
...
I am using Eclipse with C++. When I run the program, I get the following message in my Console window:
** Build of configuration Debug for project Disks Repulsion **
Internal Builder is used for build **
Nothing to build for Disks Repulsion
I makes changes to the program and run it again, and this time I get following mes...
This post closely resembles my earlier post: http://stackoverflow.com/questions/2090974/how-to-separate-cuda-code-into-multiple-files/2092091#2092091 I am afraid I made such a blunder of what I was actually asking that it will be too confusing to try and correct it there.
I am basing this code loosely off the cppIntegration example fro...
It has been a few years since I did any development for PCs (I usually do embedded software).
At that time I was highly proficient with (Borland, now CodeGear) C++ Builder. Time has moved on, C++ Builder has become extremely expensive and there are alternatives (MSVC stufio, NetBeans, QtCreator, maybe even Eclipse with the right plugi...