Clue: Look at the return value from games.erase(myIterator), you need to use it.
Type: Posts; User: SKeane
Clue: Look at the return value from games.erase(myIterator), you need to use it.
www.bruceeckel.com
Read the FAQs
Read #3 again, especially the bit about INVALIDATING ITERATORS.
google pthread
You are not doing anything with the answer the user inputs (other than storing it).
When you send the message you are using strlen(msg) rather than strlen(msg) + 1 (to include the terminatingNULL). You use strcpy() to move the message, but the "sender" didn't put a NULL on the end...
How are you getting the original message, user input?
Is your message actually "hello" + LF + NULL = 7?
Depends on the O/S but for Unix types try limits.h
Use %f in your prinf for a double, not %d that's for signed integers.
You might want to look up what a union actually is. Try to think of it as an OR. You can either look at the age OR you can look at the name. You can't use both at the same time in your example. If...
Thanks for the advice. I really should go down the singleton route, but here's what I finally did.
The DLL exports a whole class (the interface). This class' destructor calls a static "pseudo"...
The vector holds pointers to a specific class type. I'd assumed that delete'ing the pointer would call the appropriate destructor. I put a message in the destructor and if you specifically delete...
Before I get flamed too badly, yes I know there isn't a C++ static destructor.
What I'm after is a technique to clean-up after a class that consists entirely of static member functions and static...
You are overloading the read_eles function. Rather than writing a whole new function, you just have to tell the exiting function whether you are interested in hitting EOF before sentinel (1st pass)...
Perhaps because it's
#include <windows.h>
Just a thought.
You might want to consider hiding the password when the user types it in. A search of these forums would yield several possible solutions, depending on your environment O/S etc.
You are trying to subtract the value of a variable set in the child process from a variable that is set in the parent process. They can't see each other's data. The child gets a copy of the parents...
(In theory) if you plan on doing insertions into the middle of a container then a linked-list would be quicker than a vector. Of course it depends on how the writer(s) of the STL actually implemented...
But if you are going to deliberately fall through different case statements, it's advisable to clearly comment it so that at a later date someone maintaining your code does "correct" your "mistake"...
Think about what happens if you wish to insert something in the middle of a vector or the middle of a linked-list.
if (! names)
{
cout << "File not opened" << endl;
}
Do you really wish to continue if this happens?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define name1 "denny"
#define pass1 "123"
int main(int argc, char *argv[])
{
char * name;
char * pass;
int sumnum = 3;
switch(sumnum)
{
case 1:
// Do something for case 1 only
break;
case 2:
// Do something for case 2 only
break;
Your sandwiches have corners?