I have code that looks like this:
template<class T>
class list
{
public:
class iterator;
};
template<class T>
class list::iterator
{
public:
iterator();
protected:
list* lstptr;
};
list<T>::iterator::iterator()
{
//???
}
I want to make the constructor of list::iterator to make iterator::lstptr point to the list it's ...
I work in a group that does a large mix of research development and full shipping code.
Half the time I develop processes that run on our real time system ( somewhere between soft real-time & hard real-time, medium real-time? )
The other half I write or optimize processes for our researchers who don't necessarily care about the code a...
I have been writing C++ Consuole/CMD-line applications for about a year now and would like to get into windows GUI apps. For those fo you who have taken a similar step, what advice/tips can you give me. Ex: good readings, tutorials, approach tactics, etc...
I know this is a really broad question, but i really don't know how/where to s...
Question slightly in the abstract...
We have a situation where we have a struct that can be accessed by 2 or 3 threads concurrently.
We wish to signal to a thread that tries to modify the struct if it is already being modified.
e.g. The code at the moment:
thread0: struct->modify(var SomeNewState)
thread1: struct->modify(var SomeNewS...
I'm new to WinMo, and want to write a GUI application for a Windows Mobile Touch device.
I'm familiar with C#/C++, although not with any GUI development, and am writing a GUI for an application with a large C++ codebase which I've already ported to the platform successfully.
What would you reccomend for someone who is familiar with Ob...
I am trying to retrieve messages for another application with a Windows hook. I have setup a WH_GETMESSAGE hook with SetWindowsHookEx. This is done via a DLL. In my GetMsgProc fuction (that should be called whenever the target application recieves a message) I want to take action based on the type of message. However I am having trou...
Duplicate
What is your favorite C++ Interview Question?
When I was interviewing for my previous job, I was grilled on C++ questions. I actually liked the intellectual challenge, which made me even more interested in the job. At the end I was eager to start at the company, just to work with all the smart people there ;) ..
What C...
I just mistakenly did something like this in C++, and it works. Why can I do this?
int main(int argc, char** argv) {
struct MyStruct
{
int somevalue;
};
MyStruct s;
s.somevalue = 5;
}
Now after doing this, I kind of remembered reading about this trick someplace, a long time ago, as a kind of poor-man's funct...
Does anyone have any books/tutorials which may be useful in getting started in Windows device driver development?
For plain Win32/GUI development, Petzold's book seems to be the essential reference. Does such exist for drivers?
I would like to note that I'm not actually talking to hardware -- I actually want to emulate a piece of hardw...
Hi
Is anybody aware of any introductory podcasts/screencasts about programming in general that step by step familiarize viewers with the key concepts of programming using C++ as a teaching language (making basically few if any assumptions)?
I am hoping to refer some folks to such a resource, who would a) need a complete basic introduct...
What is the best way to convert an array of chars to bytes and vice versa?
Solution:
void CharToByte(char* chars, byte* bytes, unsigned int count){
for(unsigned int i = 0; i < count; i++)
bytes[i] = (byte)chars[i];
}
void ByteToChar(byte* bytes, char* chars, unsigned int count){
for(unsigned int i = 0; i < count; i++)
...
Hi there! I have a question with regards to the Binary Search Tree Implemetation in C++.
Here is the question below
Implement a simple (non-templated) BST which stores integers. Provide the following operations: Insert, Remove, inOrder traversal, preOrder traversal, postOrder traversal.
Use recursive routines for dealing with the tree....
Hi
Is there any way to use SQLSERVER SMO(sqlserver management Objects) in c++ other than Managed Code?
Help me in this regard...
I sincerely request dont give the comment as duplicate still i am not getting Clear answer
...
We have created an IE toolbar. we are displaying an icon on toolbar by using a static control and keeping image over it.
as this static control is not transparent so this icon is displaying some backgroud color(this is default color of windows common controls).
is it possible to make the static control as transparent irrespective of br...
Hi, so I'm using Visual Studio 2005 and for my current project I'm building a C# Add-In to handle the weaving of aspects for AspectC++. It's simple enough to gather the aspect and source files and feed them into the aspect compiler, but this generates new (modified) source files. I'm trying to emulate the standard AspectC++ Add-In: htt...
Whats the best way to go about modifying a C++ program to be used with pInvoke from C#.NET CF?
I have a large C++ codebase which makes extensive use of STL. Namely iterators, container classes, and standard strings.
On top of this many lightweight classes are passed around by value.
I want to build a C# gui ontop of this codebase for ...
I'm trying to write a class that when asked on, will call on a class and make it into a class member. Here's a quick example of what I mean:
class foo{
myClass Class;
foo();
};
foo::foo()
{
//Create the class and set it as the foo::Class variable
}
I'm sure this is actually an easy thing to do. Any help would be appreciated
Tha...
I have written a c++ program , I want to know how to calculate the time taken for execution so I won't exceed the time limit.
#include<iostream>
using namespace std;
int main ()
{
int st[10000],d[10000],p[10000],n,k,km,r,t,ym[10000];
k=0;
km=0;
r=0;
scanf("%d",&t);
for(int y=0;y<t;y++)
{
scanf("%d",&n);...
Hi
Is this correct, it works OK
string str("in.dat");
ifstream fin(str.c_str(), ios::binary | ios::ate );
.
.
.
//Do I need to clear the string before assigning new name???
str = "out.dat";
ofstream fout(str.c_str(), ios::binary); //seems to work
Regards
...
I'm getting a C++ compiler error which I'm not familiar with. Probably a really stupid mistake, but I can't quite put my finger on it.
Error:
test.cpp:27: error: member initializer expression list treated as compound expression
test.cpp:27: warning: left-hand operand of comma has no effect
test.cpp:27: error: invalid initialization of ...