|
strtok searches for the specified tokens within the string and when it finds a token, it replaces it with a NULL character, effectively shortining the original string to everything before the first token.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Yes, I know that but I am using parameter by value and not reference. Right now I have re-initializing the MyString variable after I make call to any functions or procedures...
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
p.a.r.t.h wrote: but I am using parameter by value and not reference.
Yes, but you pass the pointer by reference. It means that the function will make a copy of the pointer, but the copy will still point at the same memory location. If you think of a pointer being a simple integer variable (for sake of simplicity) containing a number (which is an address), when you pass that variable to your function, you will get a copy but which still contains the same number (the same address). Thus, if you modify the content of the pointer (changing what is at the specified address), the changes will be visible in your main because the pointer points at the same address.
|
|
|
|
|
I see, thanks for that. But is there a way to avoid this?
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
You may copy the CString and do whatever you want with the copy without altering the original one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is possible to prevent the use of yhe page file by a program? I want to prevent that sensitive data in RAM to be written to page file, for security reasons.
In VC++6 if possible
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
VirtualLock [^]
Pages that a process has locked remain in physical memory until the process unlocks them or terminates. These pages are guaranteed not to be written to the pagefile while they are locked
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
http://www.codeproject.com/KB/IP/SENSNetworkEvents.aspx[^]
When attempting to load this project on x64, the SENS type libary is not available in the COM tab of the References dialog.
SENS.DLL seems to be correctly registered in the registry as a type library but is not recognized in Visual Studio.
The example project is C# but the problem persists in C++ projects too.
It works fine on 32 bit.
Have tested this on several x64 boxes, same result.
Is the Visual Studio builder broken?
|
|
|
|
|
Looks like SENS.dll is built as a 32-bit binary.
If so, 64-bit EXEs cannot load 32-bit DLLs and vice versa.
«_Superman_»
|
|
|
|
|
I have two versions of SENS.DLL both version 5.2.3790.3959
According to WinMerge they are binary identical. However, they are different sizes on disk?
C:\windows\system32\sens.dll (65,024 bytes)
C:\windows\sysWOW64\sens.dll (37,376 bytes)
I also loaded them both into TextPad and they appear identical, both have length of 37,376
Why they appear different sizes on disk?
It appears that MS has accidentally released a 32 bit build of the DLL for both 32 bit and 64 bit use?
|
|
|
|
|
Hi,
I would like to know how to encode an image ( BMP / JPG) to raw images using VC++ 6.0. Presently I am using CxImage to read and display images in my application. We can read "*.raw" images using CxImage, but we can't save in "*.raw" format. It would be great help if some one can guide me regarding this.
Thanks and Regards,
Kishan
|
|
|
|
|
You've got access to the source, haven't you? That should make writing a raw image saver simple enough.
|
|
|
|
|
I might be wrong but it doesn't makes sense to write an image back to raw format. Raw file is supposed to contain the raw unprocessed data from a camera. If you process it then its no longer raw data, and you shouldn't save to as raw format.
-Saurabh
|
|
|
|
|
See here[^] for more info about RAW file format.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
How do you make a program in C++ that computes for this:
e^x = 1 + (x/1!) + ([x^2]/2!) + ([x^3]/3!) + ... + ([x^n]/n!)
where e is the euler's contant, x is the input
there should be 500 addends (so n = 499)
Thank you
|
|
|
|
|
#include <cmath>
::exp(x);
also, you could have a look here[^]
|
|
|
|
|
I don't understand what I have to do with the link you gave me. I really need this tonight. Please please please help me. I'm a noob in C++
|
|
|
|
|
I gave you the solution to get it calculated easily, by using the exp() function.
the link was an additional tip to see it used in a real context.
|
|
|
|
|
You need to use a bignum library to calc the large exponents/factorals and maintain precision.
http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic[^]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi,
this is elementary.
as always, express each term of the series as a product of the previous term and some factors;
that will give you:
- the most efficient way to perform the calculations
- the fact that the terms decrease as soon as n exceeds x
- a reasonable test for early termination of the series (for small x that is)
there is no need for special libraries, just use doubles.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
(S)He stated (s)he wants to expand to ~500.
(S)He will likely exceed the precision of a double by the mid teens.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi everyone...
Could anyone please tell me how to check for an keyboard event in win32 consol application...
I have an while loop
while(1)
{
}
I need to check each time if I have pressed a particular key....say "h"
Thanks in advance
I am a learner Always
|
|
|
|
|
Are you looking for this [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks...
But those are blocked call.....I want something like this...
My while loop keeps running.....and it checks for a key...if it was pressd it exits....But if it wasnot pressed also, my while loop keep running(iterating..)
Basically i need a nonblocking function....asynchronous
Thanks
I am a learner Always
|
|
|
|