Click here to Skip to main content
14,926,738 members

Comments by rupeshkp728 (Top 69 by date)

rupeshkp728 27-Aug-13 16:45pm View
Thanks pasztorpisti.
As per the code design I have to keep the null terminated array only.
rupeshkp728 27-Aug-13 16:00pm View
Thanks pasztorpisti for the explaination.
I had kept it to char* Name[] earlier.
But I have to do some strcpy later on in the code which was failing due to unallocated memory and so I moved to two dimensional array.
rupeshkp728 15-Apr-13 15:05pm View
But the same can also be acheived by using a common struct like "Base" in your example instead of using a macro.
Will using macro instead of a common struct make any difference?
rupeshkp728 15-Apr-13 14:55pm View
Thanks Griff for the reply.
That OOP example clears my doubt.
The intel code is also trying to implement some oop(base/derived) kind of structure, but using macros this way is really confusing.
rupeshkp728 1-Nov-12 3:01am View
I wanted some data structure to be used and not C++ CLASS and so I wrote C data structure. I had checked on net and most of them used C++ class and so I asked the question.
I felt your reply "Did you ever heard they are different languages?" some what offensive and so was my reply.
Nothing rudeness in that.

rupeshkp728 1-Nov-12 1:46am View
Well if you do not want to reply then pls do not reply such non related and useless answers.
rupeshkp728 20-Apr-12 7:57am View
Thanks Nijboer.
The same is available at
rupeshkp728 12-Feb-12 14:52pm View
Thanks Sarkukov for the reply.
I just gave an example of the process.
It can be 5 threads in one process or two separate process having two and three threads respectively.

I asked the question in linux context where threads and process are almost the same with little difference as far as IPC is concerned.
Pls correct me if I am wrong.

As an example of application assume that you have an application which is accepting io requests from user and filling the cache and then from the cache the data is moved to disks.
For this it uses say the process 1(or the threads 1 and 2) to fill the cache and there is another process 2(or say the threads 3,4 and 5) which reads data from cache and flushes data to disk.

The two process(or the two group of threads) communicate at specific intervals to find out the status of each other.

Is this example sufficient to answer my question?
rupeshkp728 21-Dec-11 5:18am View
Thanks Griff.
rupeshkp728 21-Dec-11 5:18am View
Thanks Emilio for the explaination.
rupeshkp728 1-Dec-11 2:50am View
Thanks pallini for the link.
rupeshkp728 22-Nov-11 5:39am View
Thanks Phillippe for the useful link.
rupeshkp728 22-Nov-11 3:41am View
Thanks Phillipe for the reply.
rupeshkp728 21-Nov-11 15:07pm View
Great example Stefan.
Thanks a lot for your inputs.
rupeshkp728 21-Nov-11 10:20am View
Now the doubt for question clears for question 1.

I guess I am not able to properly express second question.
In second question I want to know if the sizeof(in functions fn_base()/fn_der()) will be called at compile time or run time.

I am asking so because the functions fn_base()/fn_der() as per the code flow will be called at runtime and then sizeof() is supposed to be called from
within them.
But sizeof() being a compile time operator will it be called from within fn_base()/fn_der() afterwards at runtime?
rupeshkp728 21-Nov-11 9:30am View
Thanks Stefan for the reply.
But I am not able to understand clearly.
1) From your statement "At runtime, once the first instance of a specific class gets constructed, the vtable for that class will be constructed as well."
I understand the vtables will be created at runtime.

2) Based on understanding from reply to question 1, the sizeof() in fn_base() and fn_der() must be called at runtime for question two depending upon which function got called.
But I do not think it is functioning so.

I saw a good link which clears most of my doubt:

The link says "This table is simply a static array that the compiler sets up at compile time."
So even the sizeof() works at compile time and so it is able to get the proper size of class containing virtual functions.
rupeshkp728 21-Nov-11 9:19am View
Thanks David.
My doubt about the standard variables is clear from your statement "For plain old data (like int) members the generated code is nearly identical."
rupeshkp728 21-Nov-11 9:17am View
Thanks Lan for the nice link.
rupeshkp728 21-Nov-11 9:16am View
Thanks Stefan for the link.
It clears all my doubt.
rupeshkp728 21-Nov-11 9:11am View
Thanks Stefan ffor the reply.
Yes I am talking about benefits of implict and explicit assignemnts( not constructors ) in case of STANDARD variables.
rupeshkp728 21-Nov-11 9:04am View
Thanks Min for suggesting me the book.
rupeshkp728 21-Nov-11 5:33am View
Thanks Malli.
The link provides a good explaination.
rupeshkp728 15-Nov-11 6:47am View
Thanks Stefan for the correction.
rupeshkp728 15-Nov-11 6:45am View
rupeshkp728 15-Nov-11 6:45am View
Thanks Emilio for the reply.
rupeshkp728 15-Nov-11 5:08am View
What I understand is that the chain of responsibility will just speed up the operation and nothing else.
For example consider the following cases:
Case 1)
Suppose there are 10 interviewers in a room and one hr at the entry point of the room. There is only one candidate to be interviewed.
In this case the hr will directly decide to whom to send the candidate and send the candidate directly to the concerned interviewer.
But if there are 100 candidates then hr will take time to decide to whom to send the candiates to.
This may cause a delay.

Case 2)
To handle the delay occured in case one what the interviewer will do is to share his work with the interviewers.
The HR will directly send the candidate to the first interviewer.
The first interviewer will check if the candidate is suitable or not. If not then will send to next interviewer and so on.
So in this case the candidate handling process will speed up.

So the chain of responsibility just distributes the work and speeds up the operation and nothing else.

Is my thinking about chain of responsibility correct?
rupeshkp728 14-Nov-11 15:44pm View
Thanks Stefan your well explained note clears it all.
rupeshkp728 14-Nov-11 5:42am View
Thanks Prafulla for the reply.
rupeshkp728 14-Nov-11 5:42am View
Thanks for the clarification.
rupeshkp728 14-Nov-11 5:07am View
So this means that both notepad.exe and word.exe will have seperate 2 gb of user space each. But both will share 2 gb of system space?
rupeshkp728 14-Nov-11 3:06am View
Thanks Chuck.
rupeshkp728 13-Nov-11 15:50pm View
Thanks Chuck for the inputs.
You see I have been with all strange questions today and all these were asked to me recently causing unnecessary confusion.
I too have never ever seen such techniques being used in real life projects.
rupeshkp728 13-Nov-11 15:46pm View
Thanks Griff for the clarification.
rupeshkp728 13-Nov-11 15:32pm View
Thanks Chuck for the reply.
rupeshkp728 13-Nov-11 15:28pm View
Thanks Chuck for the reply.
The normal auto variables are stored on stack and static on data/bss.
So will two copy of struct xyz be created one on stack and other on data/bss having only static members?
rupeshkp728 13-Nov-11 15:11pm View
Thanks for the clarification.
rupeshkp728 13-Nov-11 14:36pm View
Thanks Griff for the reply.
For realloc() the msdn states "If size is zero, then the block pointed to by memblock is freed; the return value is NULL, and memblock is left pointing at a freed block."

So will not free be equivalent to realloc?
rupeshkp728 11-Nov-11 9:13am View
Thanks raiskazi for the reply.
But still my question remains unanswered.
Since using the seprate module I have I can directly find the type of mail and instanciate the appropriate mail handler class.
Then why to use chain of responsibility?
rupeshkp728 11-Nov-11 5:18am View
I gues I have changed it to something more meaningful.
rupeshkp728 8-Nov-11 9:19am View
Hey pranit this does not seem to be the answer for my question
rupeshkp728 8-Nov-11 8:33am View
Your reply clears all the doubt.
rupeshkp728 8-Nov-11 8:32am View
Your reply clears all the doubt.
rupeshkp728 8-Nov-11 8:31am View
It cleared my doubt to many extent.
rupeshkp728 8-Nov-11 8:05am View
I will take care of this in future.
rupeshkp728 24-Oct-11 11:21am View
Thanks Emilio for the clarification
rupeshkp728 24-Oct-11 5:15am View
Thanks pallini for the reply
The syntax was indeed wrong.
rupeshkp728 20-Oct-11 9:52am View
Ok I will take care.
rupeshkp728 18-Oct-11 10:14am View
Thanks for the reply.
In an another fn. I will create and instance of class and call its function.
rupeshkp728 18-Oct-11 10:13am View
Thanks Zang for the reply.
I was asking in terms of C++ which got clarified.
rupeshkp728 8-May-11 14:09pm View
Thanks Gangesh for the reply.
Anyway The log window is not showing the xml web page with output and shows only the raw source code.
rupeshkp728 8-May-11 14:08pm View
Thanks Hans for the solution.
rupeshkp728 8-May-11 14:07pm View
I think this helps as it shows the xml web page with output and not the raw source code
rupeshkp728 5-May-11 15:49pm View
thanks niklas for the inputs
rupeshkp728 5-May-11 15:39pm View
Thanks SAKryokov for the reply.
I know what is corruption of memory.
I wanted a way to debug it in case of large code base.
rupeshkp728 5-May-11 15:38pm View
Thanks Hans for the reply.
I know what is corruption of memory.
Whatever you have said I have already performed it using windbg.
I wanted a way to debug it in case of large code base.
rupeshkp728 5-May-11 15:36pm View
thanks for the reply
rupeshkp728 5-May-11 6:22am View
Thanks Fredrik for the reply.
I had asked the question because when I checked the memory of heap allocated in windbg it shows me the size as fc4 i.e. 4036 which is more then 4000 and not as desired.
Any hint as to what may be the cause?
rupeshkp728 5-May-11 6:18am View
Thanks venkat.
rupeshkp728 6-Apr-11 15:01pm View
Thanks Rick for the reply.
Its C on Windows Vista/XP with Visual Studio 2005 and Office 2003 installed
rupeshkp728 6-Apr-11 15:00pm View
what is the way?
rupeshkp728 18-Mar-11 13:36pm View
Thanks Pallini and Olivier for the reply
rupeshkp728 7-Jan-11 2:01am View
Hey Sakryukov the issue is coming up in the client code and so we have to debug and fix it as of now.
rupeshkp728 7-Jan-11 1:51am View
Thanks Sakryukov
rupeshkp728 6-Jan-11 15:58pm View
Thanks John and Marcus.
But is not there any way using debuggers to find the parent like we use in process using ppid.
rupeshkp728 6-Jan-11 15:18pm View
Platform is Windows.
Lanuage is C++.
Since its the client code and so we have to debug and fix it as of now and not to make any changes in the design of client code.
rupeshkp728 6-Jan-11 15:02pm View
That could had been a solution.
But its the client code and so we have to debug it as of now.
rupeshkp728 18-Dec-10 15:40pm View
Thanks Jim for the reply.
The thread function is getting completing execution in no time and so I am getting a count of one.
If we put the code inside the function in an infinite while loop then we properly get a thread count of 4(3 threads + main thread).
rupeshkp728 18-Dec-10 7:45am View
rupeshkp728 16-Jun-10 3:30am View
I guess I asked the question at a wrong place here.
So I have asked the same again at the C message board in codeproject.