I am trying to write a c++ program that responds to keyboard input. I want to run this as a daemon so I can't use cin, I would also like to output each character as it is pressed to a picoLCD screen that I have set up. What is the best way to do this?
...
Hello everybody,
I am using lately a tool i.e. Rhapsody for MDD with C++ and I have difficulties on coding the classes by beginning with the uml diagram. Simultaneously I am trying to integrate some of the Gof book examples in the UML diagram and somehow it confuses me....
Is there any book that 1) is quite new
(gof is 1994..) 2)
...
Hi,
I'm involved in C++ project targeted for Windows and Linux (RHEL) platforms. Till now the development was purely done on Visual Studio 2008. For Linux compilation we used 3rd party Visual Studio plugin, which read VS solution/perojects files and remotely compiled on Linux machine.
Recently the decision was to abandon the 3rd party ...
When I attempt to debug a simple program with gdb on cygwin I get the following:
C:\Users\Benoit St-Pierre\workspace_cpp\cs454>gdb a.exe
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you...
I have a class
template <typename Iterator, typename Value>
class Foo {
public:
Foo(const Iterator& it) { ... }
...
private:
map<Value, int> m_;
}
};
Is there any way to get rid of Value in the template? The Iterator may or may not be an STL iterator, but it's guaranteed that *it type is Value.
I know about iterator_traits...
I'm having some trouble returning multiple values in this program that calculates min, max, mean, median. The first thing I did was pass reference arguments, and it worked - but I read that creating a struct or class is the preferred method to returning multiple values.
So I tried and I haven't been able to get good results. Here is wha...
Hi,
I am trying to access member variables of a class without using object. please let me know how to go about.
class TestMem
{
int a;
int b;
public:
TestMem(){}
void TestMem1()
{
a = 10;
b = 20;
}
};
void (TestMem::*pMem)();
int main(int argc, char* argv[])
{
TestMem o1;
pMem = &(TestMem::T...
Here's a question that I don't quite understand:
The command, System("pause"); is taught to new programmers as a way to pause a program and wait for a keyboard input to continue. However, it seems to be frowned on by many veteran programmers as something that should not be done in varying degrees.
Some people say it is fine to use. Som...
Given:
#include <iostream>
using namespace std;
struct Concrete {
char name[20];
char quest[20];
char favorite_color[13];
};
struct Concrete_with_knobs : public Concrete {
int knobs[100000];
};
Concrete * cradle() {
return new Concrete_with_knobs;
}
void grave(Concrete *p) {
delete p;
}
void tomb_of_the_unknown_allo...
Hi,
I am developing a C++ library that I want to pass on to my team. The library has just one class with a bunch of methods.
So, I have developed the class definition file (X.cpp) and a corresponding class declaration file (X.h).
Here are my questions --
In Visual Studio 2005, whats is the most straight forward way to build this l...
I know I could just make all the Mix_Musics public, and not worry about the problem, but I'd still like to understand how to do it.
//header.h
class Music
{
private:
Mix_Music * BGMusic, * fall, * reset, * teleport, * win, * singleCubeWin;
public:
Music();
bool loadMusic();
...
I am trying to display the contents of a .cpp file in php. I am loading it using fread when I print it out it comes out formatted incorrectly. How can I keep the format without escaping each character?
...
Dear All,
I wanted to develop one HTTP example on win32 platform, which is asynchronous.
I am new to win32 programming, can i know what are the api and library win32 platform
provides for HTTP send and receive request.
I am using windows xp with VS 2005.
If any example is available directly on net please provide me link to it,
wit...
This has happened before to me, but I can't remember how I fixed it.
I can't compile some programs here on a new Ubuntu install... Something is awry with my headers.
I have tried g++-4.1 and 4.3 to no avail.
g++ -g -frepo -DIZ_LINUX -I/usr/include/linux -I/usr/include -I/include -c qlisttest.cpp
/usr/include/libio.h:332: error: ‘siz...
Hello Group,
We have a sub-project 'commonUtils' that has many generic code-snippets used across the parent project.
One such interesting stuff i saw was :-
/*********************************************************************
If T is polymorphic, the compiler is required to evaluate the typeid
stuff at runtime, and answer will be tr...
Hello,
So, I have this array. It needs to be accessed outside the scope of this function. I have been slapping a pointer to it into a pair which gets put into a deque. But once I'm outside the scope, the local stack is gone, the array is invalid, and I've just got a useless pointer, right?
So I've trying to put this array onto the scop...
I know that C++0x is not out the door yet, but what would you like to see in C++1y?
Update: C++0x to be called C++1x :o(
...
It is given in the STL reference that string class is in string header,then without including the header how the following program is running without an error??
#include<iostream>
using namespace std;
int main() {
string s;
cin>>s;
cout<<"string entered is : "<<s;
}
I am using a g++ complier on ubuntu machine.
...
Hi
Can any Body tell me wher can i get CLSID and ProgID of Smo library??
As for DMO it is givenn in a Header file by Microsoft.But i am not finding any Header file
related to smo.
What is the CLSID and ProgID of Smo ??
ANy Hep in this regard greately Appreciated.
Thanks in advance.
...
I have been having a problem identifying a flash drive in my code.
Luckily my code can be run from the flash drive. So is there a way in C (or C++) to tell what drive letter (or drive name) a program is running on?
Reason I need to know is when I plug the USB drive in, it is running a program that copies files from the computer to the ...