|
Abebe wrote: This is the coolest post i've read in the Visual C++ forum for quite some time.
oh, you've been away for a while, haven't you ?!
|
|
|
|
|
Well...i don't post that much, but i just HAD to reply to this one
Er zit een korstje op mijn aars.
|
|
|
|
|
i have a solution for you :
printf("*\n**\n***\n****\n*****\n******\n");
|
|
|
|
|
surely one can do better
<code>for(int iStars = 2, iCount = 1; iStars < 256; iStars++)
if(!(iStars & (iStars - 1)))
{for(int iDraw = 0; iDraw < iCount; iDraw++) std::cout << "*"; std::cout << std::endl; iCount++;}</code>
codito ergo sum
|
|
|
|
|
damn, that was ironic !!
i never intended to give that lazy boy a that easy solution...
|
|
|
|
|
I tought that min was ironic to, just wanted to add up to the confusion
codito ergo sum
|
|
|
|
|
erf, sorry, did not understood it that way...
you should have have much more lines... line a 100 hundred lines function
|
|
|
|
|
will do next time,
but its not as easy as it seems to write blubbery correct working code.
But I do believe that when he uses that code in the assignment It will
surely be noted by the teacher.
codito ergo sum
|
|
|
|
|
'5' for the rest...
|
|
|
|
|
Hi guys,
How can I validate CEdit (Edit box) control by Input only Alphabets (A-Z & a-z) not numbers. Any help will be greatly appreciated.
thanks n regards
viveks
|
|
|
|
|
This[^] will help.
Nibu thomas
Software Developer
|
|
|
|
|
|
In an interview I faced many question out of those, these are the questions that I could not reply properly, so please guide me to resolve these questions
queries are as follows:
1) how many ways are there to transfer values from one application to another application and and how will you do all
2)what the problem will arise when very large number of entries ( say 1000 million or more) are being inserted to the CListCtrl in MFC?
3)How would you read a file of size 5 GB when there is not enough RAM disk and virtual memory?
4)How to measure the performance of two functions working same activity?
Please help me.
Thanks.
|
|
|
|
|
|
OK, to be a little more helpful...
rajeevktripathi wrote: 1) how many ways are there to transfer values from one application to another application and and how will you do all
Lots. If you're on Windows, you can uses pipes, DDE, Windows messages, shared memory. Mutexes/events/semaphores are also possible (although slightly contrived).
There's also TCP/IP, UDP, sending stuff down a serial line. At higher level, you could also gives answers like HTTP, SOAP, REST.
You could also say things like "print something out and tell the user to type it in to the other application". It's perfectly valid and demonstrates that you can think outside the square
rajeevktripathi wrote: 2)what the problem will arise when very large number of entries ( say 1000 million or more) are being inserted to the CListCtrl in MFC?
Memory is an obvious constraint. Even if they were all empty strings, that's a huge amount of memory, not considering the overhead Windows introduces. And since list controls were never designed to handle such a large number of items, it's going to be unusably slow. If it's even possibe at all - I'm sure there's some 16-bit-based limit somewhere
And your users will hunt you down with a very large axe.
rajeevktripathi wrote: 3)How would you read a file of size 5 GB when there is not enough RAM disk and virtual memory?
Read it in chunks. Or if you're on Windows, use CreateFileMapping().
rajeevktripathi wrote: 4)How to measure the performance of two functions working same activity?
Ask them to define performance. Speed? Memory? Disk space? Average or worst case?
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Taka Muraoka wrote: Memory is an obvious constraint. Even if they were all empty strings, that's a huge amount of memory, not considering the overhead Windows introduces. And since list controls were never designed to handle such a large number of items, it's going to be unusably slow. If it's even possibe at all - I'm sure there's some 16-bit-based limit somewhere And your users will hunt you down with a very large axe.
Not to mention the delay that Windows introduces when it redraws the entire list after inserting each one . The axe is quite large indeed
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
2) is a trick question. The list control behaves relatively well up to about 5000 or so entries, in terms of update speed, scrolling, etc. After that, you have to switch to using 'virtual' mode in order for it to behave well.
The list control allocates memory for each item added. Trying to add 109 entries will cause the system to consume all available physical memory, followed by enlarging the page file. I believe the process will fail long before all of the items are added, as Windows limits the maximum page file size. In any case, your system will essentially lock up due to resource consumption.
A second poor behavior is screen updating. If you leave screen updates turned on during the item addition, that will slow the process (and make the screen flash a lot).
Software Zen: delete this;
|
|
|
|
|
Hi,
I'm getting following errors while creating 3 classes as mentioned below ...
//---------------------------
class CConfig
{
//declarations
};
//---------------------------
#include "Config.h"
class CDlg
{
CConfig m_config; //no errors
};
//---------------------------
#include "Config.h"
class CDump
{
void MyFun(CConfig config); //errors
};
//---------------------------
in class CDump i'm getting some errors as ...
error C2146: syntax error : missing ';' before identifier 'config'
error C2501: 'CConfig' : missing storage-class or type specifiers
error C2501: 'config' : missing storage-class or type specifiers
as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case?
Thanks,
Kranti
-- modified at 23:59 Monday 6th March, 2006
|
|
|
|
|
Kranti1251984 wrote: #include "CConfig.h"
Is it #include "CConfig.h" or #include "Config.h"
Nibu thomas
Software Developer
|
|
|
|
|
I'm sorry, it is
#include "Config.h"
|
|
|
|
|
Kranti1251984 wrote: I'm sorry, it is
#include "Config.h"
Now it should work!
Nibu thomas
Software Developer
|
|
|
|
|
No, that's the problem. Even though, correct header file is included, it works fine with CDlg but not with CDump.
What should I do?
|
|
|
|
|
I don't think that the line you are showing is having the problem in CDump because the errors are talking about some other variable called m_config but here(in CDump ) you have declared a variable called config .
Nibu thomas
Software Developer
|
|
|
|
|
The same line with prototype of the function, is creating problems for the variable config of type CConfig.
-- modified at 0:02 Tuesday 7th March, 2006
|
|
|
|
|
I have this problem when I have 2 or more file Included eachothere (file 1 include file 2 & file 2 include file 1)
Iman Ghasrfakhri
|
|
|
|