|
asadullah ansari wrote: Some reason
because same pointers should imply same objects (and same types), different pointer values different objects.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
The reason is very subjective.
In the below posts you can find the link to Stroustroup site, and his "official" answer.
The interesting thing is that the argumentation he provides are good for C as well.
IMHO, I think it was just a different "taste" between K&R and B.S.
In C a struct is just a "bouch of bytes" and and address is just a "place in memory".
In C++ a struct is an "object" and an address is an "object identity" (and two objects must not have the same one).
Of course we can discuss if C++ classes and structs are "real" object or just tools to assemble them ... but it is still another matter of "taste".
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
that is what ++ in C++ means: add 1.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
reallly funny ...gud
Truth Can'nt be changed
|
|
|
|
|
|
Not being the creator of the language I can't answer definitively so I'll just refer you to the "Design and Evolution of C++" by Bjarne Stroustrup.
I hope you won't be disapointed by the answer!
Cheers,
Ash
|
|
|
|
|
to call a function you need a memory address for the function pointer. So you need the size of a void*. Typically 4 Bytes.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
Does anyone know of any free c++ matrix class libraries? In particular, I want to be able to search the matrix for values, obtain min/max values for each of the columns, be able to add/delete columns on the fly, etc.
The more matlab "like" it is the better.
Thanks,
|
|
|
|
|
b-rad311 wrote: Does anyone know of any free c++ matrix class...
Like a multi-dimension array?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
It looks as you need somethink like dynamic two dimentional array.What about using STL classes? For example vector of vectors of specific type behaves like "dynamic" matrix.
Life is a stage and we are all actors!
|
|
|
|
|
Hi,
Previously I was using vector of vectors but it seemed to be running slow for what I needed to do, so I was looking for optimized matrix class. The matrix is about 1,000,000 x 13
|
|
|
|
|
Wow, that's huge. I hope it is a sparse matrix and you might find a less resource-consuming way to represent the data.
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, I'll check it out. Have you had good experience with it?
|
|
|
|
|
nope, no experience.
we use Intel's MKL instead (mostly due to historical reasons)
Watched code never compiles.
|
|
|
|
|
u can download from
http://www.freedownloadscenter.com/Programming/C_and_C++_Tools_and_Components/C___Matrix_Template_Class_Library.html
Truth Can'nt be changed
|
|
|
|
|
Anyone know of any good books or courses on WiX? There are some online tutorials, but they are incomplete, and a nice book would go down a treat. Our needs are fairly complex, in that we need to install multiple files, register and start services, and COM objects, create registry entries populated from user input in custom dialogs, create merge modules, create patches and so on.
|
|
|
|
|
How to make dialog controls or form view controls
resizable when the frame window is resizing
|
|
|
|
|
Sakhalean wrote: How to make dialog controls or form view controls
resizable when the frame window is resizing
You will need to trap the WM_SIZE message and then send a resize (MoveWindow() or similar) message to each control, telling it how big it needs to be.
It's time for a new signature.
|
|
|
|
|
See if the Extras section of this article is of any help.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
|
I have a long routine that I'm thinking to modify splitting it in different parallel worker-thread. This to try to reach 100% on multicore CPU and let the time required be less.
Now when I start the worker-threads (say 3-5) the main-thread have to (simply) wait that the other worker-threads ends. Then it have to repeat this stage for many iterations.
A simple solution I found is to start in the main-thread a loop that do a simple Sleep (for some ms) and then checks some flags that the worker-threads sets when ending. When it understand that all the threads are end it make some computations and start all again.
What I test is that for long worker-thread it seems to work (CPU reaches 100%), but when the worker-thread are very shorts (some ms) it looks that the CPU doesn't reach high values.
I think because the time spent into the sleep function is too much in comparison with the time required from the worker thread.
Because the time required from the worker-thread depends on a complex combination of the input parameters and I can't estimate at the beginning then I tried to start with a sleepTime = 2m (very low!) increasing it after every loop of the main-thread. But again the CPU in case of short processing looks to low.
Any suggestion? Diffent approaches?
Russell
|
|
|
|
|
I'm using AfxBeginThread ... it is efficient or is it spending a little time to make some check before exit?
Russell
|
|
|
|