Below I have attempted to write a sudo code for the Observer pattern when observers wish to observe different items.
Ignore the syntax errors. I wish to know if this is the correct way to implement...
Type: Posts; User: AnishaKaul
Below I have attempted to write a sudo code for the Observer pattern when observers wish to observe different items.
Ignore the syntax errors. I wish to know if this is the correct way to implement...
This is what I have thought:
Logging the chat messages (exchanged by the
clients) on the server.
Registration of ALL clients on the server on
their start up.
Client should be able to add...
Thanks, but replies weren't `too` helpful.
Anyway, can we "see" the debugging symbols somewhere, through GDB?
Perhaps I'll be able to understand them better then.
Wikipedia says:
1. Any examples of what kind of programming-language constructs are used for the purpose?
2. What is the meaning of "constructs" in this context? Functions?
Please try...
Now I realize that I was getting confused by the sequence of the events, the base class is indeed getting called first, but my problem is NOT yet solved, I'll get back to you soon.
Thanks again.
See this: The green one too executes and func. gets called. but still the red statement gets executed.
#include <iostream>
#include <vector>
#include <string>
using namespace std;
...
I did that Elysia, before posting here, it resulted in the same problem as stated in my last post, that's why I replaced it with the BaseClass's object.
Nothing, I just want to fill that vector...
Thanks for all the effort, Elysia, now I please make me understand why can't the values in the derived class be reflected in the base class:
I think the problem is that I should call the the...
Thanks for all the effort, I tried to call the vector in the derived class, I failed :(
#include <iostream>
#include <vector>
using namespace std;
template <class MyDummyClass, typename...
Yes you are right, I explained it wrongly, templates do pass types at compile time,
What I want to do is:
The base class which contains the vector, will have various derived classes and the...
Actually, that works if I specify the type in the base class, but the problem is that the type of the first argument will be decided by the derived class, using a template means that we can pass a...
I ve already tried that Elysia, that doesn't work: :(
#include <iostream>
#include <vector>
using namespace std;
template <class MyDummyClass, typename ReturnType, typename Parameter>...
I think this makes some sense now:
template<typename t>
class stuff {
public:
vector<t> data;
};
Thank you Elysia and anon.
Thanks for pointing out, it was not a deliberate fault from my side.
I have corrected that too now, but the error persists.
It seems I haven't yet...
I tried this:
#include <iostream>
#include <vector>
using namespace std;
template <class MyDummyClass, typename ReturnType, typename Parameter>
class SingularCallBack
{
Heap is something from which you can allocate memory (ofcourse at run time)
The memory can be allocated only to pointer variables.
Pointer is a variable which points to a location in the heap.
You...
Thank you for that, if I have further queries I'll post here again.
I am sorry if I am missing your point again, but did you mean that the previous entry which I want to be edited should be removed and then a fresh entry with the fresh data should be made?
Thanks TabStop, but I didn't understand the following:
Thanks for replying,
Q: Can I edit the key itself?
Q: The value associated with the key is a socket pointer, so even if I exchange the positions of the current key and its value somehow, then...
I have inserted some values in a C++ Map, now I want to edit the value associated with a key. I can insert and delete but how to edit?
Any hints?
I have tried this:
map <unsigned int,...
Thanks for bothering :)
One incomplete rough way of representing the structure shown in my first post is by using "structures":
struct x
{
string name;
int id;
};
Well, can the structure I showed here be represented with a combination of vectors, maps and pairs in any way?
I was confused unnecessarily for no obvious reasons :redface: Thanks.
I am thankful to you for the enlightenment :hattip: Actually recently I had used map and pair (they take multiple arguments) so I was trying to use vector that way!
Thanks for the clarification...