|
Better.
Not as expressive, though.
Plus it might or might not be faster.
E.g. the function could need a very large temporary array in its algorithm.
This would then enlarge the callers array, without shrinking it, like a copy would do.
Also, it is not as easy to not touch the callers array in case of the call not succeding.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: E.g. the function could need a very large temporary array in its algorithm.
This would then enlarge the callers array, without shrinking it, like a copy would do.
You can address all the above requirements inside method definition without loss of efficiency (e.g. if you need a temporary array then explicitely instantiate it, no need to pollute caller array).
The code snippet shows how to remove an unnecessary copy step. If it is a big advantage or not depends on method logic, of course.
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.
|
|
|
|
|
jhwurmbach wrote: Because the board software eats all >...
Only if it first finds a < character.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
OK, I might have used the wrong word: What are < > called, then?
In German, < ( [ and { are all called "Klammer", with the possible distinction as "spitz" (pointed), "rund" (rounded), "eckig" (squared) and "geschweift" (cambered?) when needed.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: OK, I might have used the wrong word...
No, I was just saying that replacing both of them was not necessary. Simply replacing the left bracket is all that's necessary.
jhwurmbach wrote: What are < > called, then?
Angle brackets.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All
i want to block CD/DVD comnication, Not to hide the CD drive.Souupose u have CD in ur ROm and if u try to access the it shows acess denay .
Thanks in advance
RYK
|
|
|
|
|
There used to be a registry value named HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewOnDrive that you could change.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This Key "NoViewOnDrive" does not exist on given location and if i have to create this key then what value should be assigned against this key.
|
|
|
|
|
VC_RYK wrote: ...if i have to create this key then what value should be assigned against this key.
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello All,
i want to release unused memory from my application which is developed using MFC.
so is there any to find unused memory and release it as GC is doing.,
please share your knowledge with me.
thanks
Bankey
|
|
|
|
|
The rule is simple: each time you allocate memory with new, you should delete it (using delete) when you don't need it anymore.
There's no way to find unused memory, you have to keep the pointers to allocated memory so that you can clean them later on.
|
|
|
|
|
i am using c programming
hi i need to break up an int value to parts any one know how to do that?
example
112233
i need to stor them as
11
22
33
wats the function for it?
|
|
|
|
|
int nValue = 112233;
int n1 = nValue / 10000;
nValue -= ( n1 * 10000 );
int n2 = nValue / 100;
nValue -= ( n2 * 100 );
int n3 = nValue;
|
|
|
|
|
int i = 112233;<br />
<br />
while(i)<br />
{<br />
cout<<i%100<<endl;<br />
i /= 100;<br />
}
- Malli...!
|
|
|
|
|
cool,
but here arent the numbers getting printed in reverse.
|
|
|
|
|
int nValue = 112233;
int nDiv = 1000000;
while ( nDiv /= 100 )
{
cout<<nValue/nDiv<<endl;
nValue -= ( nDiv * ( nValue /nDiv ) );
}
|
|
|
|
|
void breakint(int i)
{
if (i%100)
{
breakint(i/100);
printf("%d \n", i%100);
}
else
return;
}
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.
|
|
|
|
|
Easy: Format a string out of it and than split as you want.
Fast: shifting look for ">>" operator.
zzz:
Greetings from Germany
|
|
|
|
|
Hi All,
I have developed MFC Application with command line arguments.
In Batch file I am writing ,
FastCopy.exe Source_path Dest_path >C:\log.txt
The redirection of output from console window to C drive is not working . Copying is successfully done.
Case 1)
As this is MFC Application , I have use following to parse command line arguments.
CString sCmdLine= AfxGetApp()->m_lpCmdLine;
Case 2)
In case of Windows Console Application , i have handle the command line in Main function using argc and argc. The redirection of output is working fine in this case also the copy.
I am using "CreateProcess(0, ptr, 0, 0, FALSE, 0, 0, 0, &si, &pi)" in both case where ptr is pointer to string
"C:\Robocopy.exe \\Folder1 \\Folder2"
The redirection is problem in case of MFC application. Can anybody please let me know where I am going wrong. If there anyother solution let me know
Thanks in Advance
Ashish.
|
|
|
|
|
Ash20 wrote: FastCopy.exe Source_path Dest_path >C:\log.txt
The redirection of output from console window to C drive is not working . Copying is successfully done.
How is fastcopy.exe writing to the console window?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have win32 dll. I wanted to have Timer in this so that I can call a function after some time and kill that timer.
Is it possible? How?
Thanks,
AmolM
|
|
|
|
|
You can use WaitForSingleObject-API with a timeout values.
Greetings from Germany
|
|
|
|
|
use SetTimer() win32 api
Prasann
who else
|
|
|
|
|
I am trying to use wxwidgets instead of mfc but not able to build it I am getting linking error kernel32.lib but I have included in the dependencies
S.Yamini
|
|
|
|
|
What are you trying to do exactly ? Building wxWidget libraries or building an application that uses wxWidgets ?
What is the exact error message ?
|
|
|
|