//my program to long and have error..i want to make it simple and easy to read..how to change it in switch program?? help me please!! =(
#include <iostream>
using namespace std;
int main ()
{
int movie1;
int movie2;
int movie3;
int seats;
int price;
int select;
char response;
cout<<"______Wellcome to S...
hello,
i need to use the function in another class file as thread
int main()
{
master t;
boost::thread t1(boost::bind(t.start, "exampl"));
t1.join();
}
i have an class master and a function start ..i need to pass an value to it and run
i have used this in same class it works fine...can any one tell me where i am wrong
...
Possible Duplicate:
Constants and compiler optimization in C++
Let the holy wars begin:
I've heard a number of differing opinions on the usefulness of const in C++. Of course it has uses in member function declarations, etc. But how useful is it as a modifier on variables (or rather, constants)? Does it indeed help the optimiz...
I need a simple interpreter which will do execution (evaluation) of simple expressions/statements and also call functions from main C++ applications. At the moment I do not need scripting of the application, but it may be useful later.
It should also be strait-forward for other team members to pull my application from Source Repository ...
Hello,
I want to use a cache, implemented by boost's unordered_map, from a dynamic_bitset to a dynamic_bitset. The problem, of course, is that there is no default hash function from the bitset. It doesn't seem to be like a conceptual problem, but I don't know how to work out the technicalities. How should I do that?
Thanks.
...
In order to make a deep copy of myArr,
vector <Point> myArr;
where Point is a class with 2 ints as members,
Do I need to do something special? or is ok with
vector <Point> otherArr = myArr;
I need to delete some points in otherArr but at the same time I need all the points in myArr for later usage.
thanks in advance
...
Hi everybody,
I am developing the design of an application and I thought I might apply some sort of the Visitor design pattern, but it turned out that it's not exactly what I am looking for. Maybe someone can point me to the variant I require in this case?
Much of my code has a template argument "ContainerType" like
template <class Co...
What is the proper way to subclass a tab control in winAPI, having windows perform both the default drawing and your own. Because BeginPaint() and EndPaint() are calling within the default proc, I don't see a way to do this. I did get it working with GetDC(), but it had a very bugs which annoyed the hell out of me.
If what I am asking i...
I have a multithreaded server application that needs mutex locks over some shared memory.
The shared memory are basically sTL maps etc.
Much of the time I'm just reading from the map.
But, I also need to occasionally add to it.
e.g.
typedef std::map MessageMap;
MessageMap msgmap;
boost:shared_mutex access_;
void ProcessMe...
Hello to all, I have create a simple application which using C++ and produce a executable file.
I would like to ensure the process cannot be start twice. How to enforce a process/service is start once only ?
Thanks.
...
Ignore this question, just found a mistake in my code, flag to delete it
This is from "Templates - the complete guide" ch. 19.2
Compound types are types constructed from other types. Simple compound types include plain types, pointer types, reference types, and even array types. They are constructed from a single base type. Class types ...
I need a container in which I can check if a sequence of elements are present or not. Same thing as substring matching, just for generic collections. I know it's not hard to write, but if it's implemented in some lib already, I wouldn't bother (maybe Boost has something like this?)
...
Imagine we have a solution with 2 projects: MakeDll (a dll app), which creates a dll, and UseDll (an exe app), which uses the dll. Now I know there are basically two ways, one is pleasant, other is not. The pleasant way is that UseDll link statically to MakeDll.lib, and just dllimports functions and classes and uses them. The unpleasant ...
I have a modal dialog I'm creating with MFC. When it appears, the Aero theme does it's fade-in transition for a new window appearing. In my particular case I'm switching immediately from one dialog to another and the fade effect is distracting. Is there a way it can be disabled so the window immediately appears, like it does when Aero...
How should I add methods a Protobuf message?
Suppose I have in my .proto file:
package proto;
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
}
and I want to add a method, say, string concatenateNameEmail() to the message.
What I do right now is I create my own C++ class like th...
I've been spending more and more time writing DB Wrappers for Oracle access. This seems to be quite generic procedure, and I was wondering is there already are code generators that generate access routes to Oracle PL/SQL Stored Procedures in C++?
I'm looking for a configurable generation tool that would be capable of managing connection...
First of all, on my system the following hold: sizeof(char) == 1 and sizeof(char*) == 4.
So simply, when we calculate the total size of the class below:
class SampleClass { char c; char* c_ptr; };
we could say that sizeof(SampleClass) = 5. HOWEVER, when we compile the code, we easily see that sizeof(SampleClass) = 8.
So the question...
Hi Folks,
My C++ application has to receive alerts from the PostgreSQL database, as soon as any data is modified in tables. Can you please advice to implement this in best possible way.
Please note that alert information would also need to have the information of the data that has been changed.
Thanks,
Gtk
...
First of all, I say we use C++ because it is used in a lot of projects open source, e.g. KDE. Moreover, Google uses C++ as its primary language. Now, the point that bugs me is that we have all heard rants about C++. Alan Kay's talk at OOPSLA '98 is pretty impressive. Yet, there is widespread use of C++ and thus my question above. Possibl...
Hello, I am a student, and new to c++. I am searching for a standard c++ api that is as comprehensive as the java api. I have been using cplusplus.com, and cppreference.com. Please any help would be greatly appreciated.
...