|
Try with
getline(cin,str); which won't eat whitespace (except the final return key).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
WREY wrote:
How do I determine a string is empty, coming from the input stream?
You could try writing your own version of the getline function. I've done what I think you are trying to do by doing inputstream.get( char ). You can continue scanning the input until you get a newline character or whatever you want. The only problem is that a carriage return will have to have been pushed for the input to go into the stream. And if you want to keep track of the entire input, you can just keep adding each character to a string. I hope this helps, good luck.
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
hi..
Assuming there is alist ctrl in a dlg..
How do i handle a LVN_ITEMCHANGED message in the OnCmdMSg,, instead of
actually handling LVN_ITEMCHANGED message for the list ctrl ??
Any help is appreciated.
Thanx
saleem
|
|
|
|
|
LVN_ITEMCHANGED is a notification sent by the list control to its parent, in this case your dialog. OnCmdMsg is a handler for a command message. Perhaps if the command handler and the notification handler need to do something in common, you could create a single function that both handlers use?
Software Zen: delete this;
|
|
|
|
|
Hi,
In my MFC app,i create Menus dynamically.In this case how to trap the messages when menu item is selected or clicked.I overrddden OnCmdMsg() routine..but somehow i don't get the handle for the selected MenuItem..Pl help.
Thanks in advance
Ram
|
|
|
|
|
Why are you not using the wizard to create the handle? The wizard (not sure about .net still learning how they have changed it). This creates the method in the .h, the macro to handle and the skeleton method. Then all you need to do is add the meat! Is there something extra that you are trying to accomplish?
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
|
I'd like to create functions that copies a specific string (array of char) from another, starting at a specific offset and have a specific length.. probably something like this
char* CopyStr(const char* pszFrom, int nOffset, int nLength);
How can I do it without using CString or std::string?
|
|
|
|
|
|
or memcpy
memcpy(pDest,pFrom+nOffset,nLength*sizeof(char))
|
|
|
|
|
With memcpy, you will need to manually add the terminating NULL or preinitialize the destination buffer with NULLs.
Steve
|
|
|
|
|
Hi ,
Does any body have some examples on SNMP in C or C++?? (Not from MSDN)
Or suggest some web site.
Thanks and Regards,
Satya
|
|
|
|
|
What is SNMP???
Well... I am a beginner ...
|
|
|
|
|
SNMP stands for Simple Network Management Protocol. Most of the Network Management Systems use this protocol to Manage the Network products.
Satya
|
|
|
|
|
Hi,
For last 3 months i am looking for some one who can help me to get process wise cpu usage in NT (i have the procss ID). could anybody pls. tell me how to do that. it will help me alot.
* could u pls. tell me how to get process wise memory usage in win 9x?
pls. help me to get out of this problem.
pradip
|
|
|
|
|
thank's for getprocesstime() but from this time how will i get the cpu usage of that process.
pls. help me
pradip
|
|
|
|
|
thank's for getprocesstime() but from there how will i get the cpu usage of that process.
pradip
|
|
|
|
|
|
thank u for the code which u have posted, but could u pls. tell me how to calculate the process wise cpu usage if more than one instance of a process (i.e "MSAccess") is running.
if it is possible for u pls. send me some code.
pradip
|
|
|
|
|
My project configuration is debug, I am running my program under the debugger and I have included the following code (as doco suggests):
#define _CRTDBG_MAP_ALLOC<br />
#include <stdlib.h><br />
#include <crtdbg.h><br />
<br />
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );<br />
But still no line numbers!
Detected memory leaks!
Dumping objects ->
{4879} normal block at 0x00D02C78, 12 bytes long.
Data: <Up: -0.012 > 55 70 3A 20 20 2D 30 2E 30 31 32 00
.......
etc
Clearly I am doing something wrong.
Any advice will be a great help. I am running under VS .Net btw.
-A-
....now where does this plug in....
|
|
|
|
|
Why is it that C++ has header files while Java and C# don't?
|
|
|
|
|
It is for extending the programming language.. You can create a function which takes many lines to write and put it in a header file so when you need that code again you dont rewrite it but you just include the header file..
Well... I am a beginner ...
|
|
|
|
|
Because C++ has to be linked. Compilation units need to know about the declarations of types in other compilation units. Interpreted languages can wait until the VM is running to test whether all required compilation units are present.
C++ needs a way of not ending up with duplicate definitions, in multiple compilation units.
Header files generally contain just the declarations.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Rudyard Kipling is wrong; The Earth can never be yours, nor everything that is in it!
|
|
|
|
|
Actually I hated it when the first time I started to learn Java and C# and found out that they don't have header files, every function body reside in the class definition making the class definition so lengthy and hard to read, sometimes they look like a mess to me. I think I like C++ header files very much.
|
|
|
|